Setup
Your first Blockchain Application is just minutes away

Getting Started

Make use of our npm repository to add it to your node project of choice or Clone the Relysia SDK repository from https://github.com/kohze/relysiaSDK to add it locally to your project. Alternatively we also offer a CDN to integrate the Relysia SDK into traditional html pages.
1
npm i relysia
Copied!
Alternatively, install the newest development version via GitHub
1
git clone https://github.com/kohze/relysiaSDK
Copied!

Initialize the Library

Each Relysia SDK interaction starts with getting the Authentication Token. To get a Authentication token, load the Relysia SDK either via NPM or CDN and start with the following lines.
JavaScript
JavaScript ES6
1
const RelysiaSDK = require('relysia');
2
3
const relysia = new RelysiaSDK();
4
await relysia.auth({email: "[email protected]", password: "pass"});
Copied!
1
import RelysiaSDK from 'relysia';
2
3
const relysia = new RelysiaSDK();
4
await relysia.auth({email: "[email protected]", password: "pass"});
Copied!
Make sure the authentication codes are not shared publicly.
If you want to use CDN, you can simply add the CDN link with the <script> tag in your HTML,
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
<meta charset="UTF-8">
5
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/relysia-sdk.js"></script>
8
</head>
9
<body>
10
<script>
11
const relysia = new RelysiaSDK();
12
</script>
13
</body>
14
</html>
Copied!
In case you already have the authentication token from your firebase frontend application use:
1
const relysia = new RelysiaSDK(authToken: '');
Copied!

Account details

User details are typically an essential part of your user management and platform experience. To access user account details, such as email, name or profile picture, call the getUserDetails() function as indicated below.
1
const response = await relysia.getUserDetails();
Copied!