Skip to content

Commit

Permalink
Merge pull request #11 from ElarianLtd/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
aksalj authored Jan 30, 2024
2 parents 10862a4 + 396b865 commit 9e7992d
Show file tree
Hide file tree
Showing 36 changed files with 507 additions and 20,382 deletions.
19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,24 @@ $ npm install elarian@latest

```javascript

// on node
const { initializeClient } = require('elarian');
/*
or in the browser
<script src="web.js"></script>
// or import { initializeClient } from 'elarian/web'
*/


// ...

const elarian = await initializeClient({
apiKey: 'YOUR_API_KEY', // or authToken: 'YOUR_AUTH_TOKEN'
orgId: 'YOUR_ORG_ID',
sessionId: 'YOUR_SESSION_ID',
appId: 'YOUR_APP_ID',
});

elarian.on('reminder', (data, customer) => {
elarian.on('consentDenied', (userId, data) => {
// ...
});

const userId = 'abc...';
const { state } = await elarian.leaseAppState(userId);
const data = JSON.parse(state.stringVal);
await elarian.updateAppState(userId, { stringVal: JSON.stringify({ ...data, status: 'good boy' }) });
await elarian.updateMetadata(userId, { bio: { bytesVal: Buffer.from('age=29;gender=female') }});
const { state } = await elarian.fetchAppState();
const data = JSON.parse(state.toString());
await elarian.updateAppState({ state: Buffer.from(JSON.stringify({ ...data, status: 'good boy' })) });

```

Expand Down
14 changes: 7 additions & 7 deletions docs/Client.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="client.js.html">client.js</a>, <a href="client.js.html#line31">line 31</a>
<a href="client.js.html">client.js</a>, <a href="client.js.html#line16">line 16</a>
</li></ul></dd>


Expand Down Expand Up @@ -250,7 +250,7 @@ <h4 class="name" id="connect"><span class="type-signature"></span>connect<span c

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="client.js.html">client.js</a>, <a href="client.js.html#line110">line 110</a>
<a href="client.js.html">client.js</a>, <a href="client.js.html#line62">line 62</a>
</li></ul></dd>


Expand Down Expand Up @@ -360,7 +360,7 @@ <h4 class="name" id="disconnect"><span class="type-signature"></span>disconnect<

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="client.js.html">client.js</a>, <a href="client.js.html#line171">line 171</a>
<a href="client.js.html">client.js</a>, <a href="client.js.html#line82">line 82</a>
</li></ul></dd>


Expand Down Expand Up @@ -448,7 +448,7 @@ <h4 class="name" id="isConnected"><span class="type-signature"></span>isConnecte

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="client.js.html">client.js</a>, <a href="client.js.html#line164">line 164</a>
<a href="client.js.html">client.js</a>, <a href="client.js.html#line75">line 75</a>
</li></ul></dd>


Expand Down Expand Up @@ -626,7 +626,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="client.js.html">client.js</a>, <a href="client.js.html#line337">line 337</a>
<a href="client.js.html">client.js</a>, <a href="client.js.html#line171">line 171</a>
</li></ul></dd>


Expand Down Expand Up @@ -808,7 +808,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="client.js.html">client.js</a>, <a href="client.js.html#line322">line 322</a>
<a href="client.js.html">client.js</a>, <a href="client.js.html#line156">line 156</a>
</li></ul></dd>


Expand Down Expand Up @@ -882,7 +882,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Client.ht
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Tue Jul 11 2023 09:39:58 GMT+0300 (East Africa Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Tue Jan 30 2024 14:26:49 GMT+0300 (East Africa Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
Loading

0 comments on commit 9e7992d

Please sign in to comment.