diff --git a/README.md b/README.md index acfd851..52ad3d2 100644 --- a/README.md +++ b/README.md @@ -16,31 +16,24 @@ $ npm install elarian@latest ```javascript -// on node const { initializeClient } = require('elarian'); -/* -or in the browser - -// 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' })) }); ``` diff --git a/docs/Client.html b/docs/Client.html index 36dfeff..a718de4 100644 --- a/docs/Client.html +++ b/docs/Client.html @@ -142,7 +142,7 @@
Parameters:
Source:
@@ -250,7 +250,7 @@

connectSource:
@@ -360,7 +360,7 @@

disconnect<
Source:
@@ -448,7 +448,7 @@

isConnecte
Source:
@@ -626,7 +626,7 @@

Parameters:
Source:
@@ -808,7 +808,7 @@
Parameters:
Source:
@@ -882,7 +882,7 @@

Home

Classes