@cobaltio/cobalt-js 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +265 -250
- package/cobalt.js +0 -1
- package/docs.md +14 -0
- package/package.json +34 -34
package/README.md
CHANGED
|
@@ -1,250 +1,265 @@
|
|
|
1
|
-
# cobalt.js
|
|
2
|
-
Cobalt frontend SDK.
|
|
3
|
-
|
|
4
|
-
## Install
|
|
5
|
-
|
|
6
|
-
#### npm
|
|
7
|
-
```bash
|
|
8
|
-
npm install @cobaltio/cobalt-js
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
#### yarn
|
|
12
|
-
```bash
|
|
13
|
-
yarn add @cobaltio/cobalt-js
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Usage
|
|
17
|
-
|
|
18
|
-
<!-- Check the SDK [documentation](docs.md) for detailed information. -->
|
|
19
|
-
|
|
20
|
-
### Include
|
|
21
|
-
|
|
22
|
-
#### Browser
|
|
23
|
-
```html
|
|
24
|
-
<!-- import the latest version -->
|
|
25
|
-
<script src="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js"></script>
|
|
26
|
-
<!-- import a specific version -->
|
|
27
|
-
<script src="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js@2"></script>
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
#### Node
|
|
31
|
-
```js
|
|
32
|
-
// CommonJS
|
|
33
|
-
const Cobalt = require("@cobaltio/cobalt-js");
|
|
34
|
-
// ESM
|
|
35
|
-
import Cobalt from "@cobaltio/cobalt-js";
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Initialize
|
|
39
|
-
```js
|
|
40
|
-
// initialize with token
|
|
41
|
-
const cobalt = new Cobalt({
|
|
42
|
-
// the token you generate for linked accounts using the cobalt backend SDK
|
|
43
|
-
token: "COBALT_SESSION_TOKEN",
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// initialize without token
|
|
47
|
-
const cobalt = new Cobalt();
|
|
48
|
-
// the token you generate for linked accounts using the cobalt backend SDK
|
|
49
|
-
cobalt.token = "COBALT_SESSION_TOKEN";
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### SDK
|
|
53
|
-
|
|
54
|
-
## Classes
|
|
55
|
-
|
|
56
|
-
<dl>
|
|
57
|
-
<dt><a href="#Cobalt">Cobalt</a></dt>
|
|
58
|
-
<dd><p>Cobalt Frontend SDK</p>
|
|
59
|
-
</dd>
|
|
60
|
-
</dl>
|
|
61
|
-
|
|
62
|
-
## Typedefs
|
|
63
|
-
|
|
64
|
-
<dl>
|
|
65
|
-
<dt><a href="#Label">Label</a> : <code>Object</code></dt>
|
|
66
|
-
<dd><p>Field Mapping Label</p>
|
|
67
|
-
</dd>
|
|
68
|
-
<dt><a href="#DynamicField">DynamicField</a> : <code>Object</code></dt>
|
|
69
|
-
<dd><p>Field Mapping Label</p>
|
|
70
|
-
</dd>
|
|
71
|
-
<dt><a href="#DynamicFields">DynamicFields</a> : <code>Object</code></dt>
|
|
72
|
-
<dd><p>The dynamic fields payload.</p>
|
|
73
|
-
</dd>
|
|
74
|
-
<dt><a href="#Config">Config</a> : <code>Object</code></dt>
|
|
75
|
-
<dd><p>The configuration data for an application.</p>
|
|
76
|
-
</dd>
|
|
77
|
-
<dt><a href="#Workflow">Workflow</a> : <code>Object</code></dt>
|
|
78
|
-
<dd><p>The workflow.</p>
|
|
79
|
-
</dd>
|
|
80
|
-
</dl>
|
|
81
|
-
|
|
82
|
-
<a name="Cobalt"></a>
|
|
83
|
-
|
|
84
|
-
## Cobalt
|
|
85
|
-
Cobalt Frontend SDK
|
|
86
|
-
|
|
87
|
-
**Kind**: global class
|
|
88
|
-
|
|
89
|
-
* [Cobalt](#Cobalt)
|
|
90
|
-
* [new Cobalt(options)](#new_Cobalt_new)
|
|
91
|
-
* [.connect(slug, [payload])](#Cobalt+connect) ⇒ <code>Promise.<Boolean></code>
|
|
92
|
-
* [.disconnect(slug)](#Cobalt+disconnect) ⇒ <code>Promise.<void></code>
|
|
93
|
-
* [.config(slug, configId, [fields])](#Cobalt+config) ⇒ [<code>Promise.<Config></code>](#Config)
|
|
94
|
-
* [.
|
|
95
|
-
* [.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
|
122
|
-
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
|
146
|
-
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
**
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
|
|
|
160
|
-
|
|
161
|
-
<
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
|
185
|
-
|
|
|
186
|
-
|
|
187
|
-
<
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
|
198
|
-
|
|
|
199
|
-
|
|
200
|
-
<
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
|
211
|
-
|
|
212
|
-
<
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
|
236
|
-
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
**
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
|
248
|
-
|
|
|
249
|
-
|
|
|
250
|
-
|
|
|
1
|
+
# cobalt.js
|
|
2
|
+
Cobalt frontend SDK.
|
|
3
|
+
|
|
4
|
+
## Install
|
|
5
|
+
|
|
6
|
+
#### npm
|
|
7
|
+
```bash
|
|
8
|
+
npm install @cobaltio/cobalt-js
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
#### yarn
|
|
12
|
+
```bash
|
|
13
|
+
yarn add @cobaltio/cobalt-js
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
<!-- Check the SDK [documentation](docs.md) for detailed information. -->
|
|
19
|
+
|
|
20
|
+
### Include
|
|
21
|
+
|
|
22
|
+
#### Browser
|
|
23
|
+
```html
|
|
24
|
+
<!-- import the latest version -->
|
|
25
|
+
<script src="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js"></script>
|
|
26
|
+
<!-- import a specific version -->
|
|
27
|
+
<script src="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js@2"></script>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
#### Node
|
|
31
|
+
```js
|
|
32
|
+
// CommonJS
|
|
33
|
+
const Cobalt = require("@cobaltio/cobalt-js");
|
|
34
|
+
// ESM
|
|
35
|
+
import Cobalt from "@cobaltio/cobalt-js";
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Initialize
|
|
39
|
+
```js
|
|
40
|
+
// initialize with token
|
|
41
|
+
const cobalt = new Cobalt({
|
|
42
|
+
// the token you generate for linked accounts using the cobalt backend SDK
|
|
43
|
+
token: "COBALT_SESSION_TOKEN",
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// initialize without token
|
|
47
|
+
const cobalt = new Cobalt();
|
|
48
|
+
// the token you generate for linked accounts using the cobalt backend SDK
|
|
49
|
+
cobalt.token = "COBALT_SESSION_TOKEN";
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### SDK
|
|
53
|
+
|
|
54
|
+
## Classes
|
|
55
|
+
|
|
56
|
+
<dl>
|
|
57
|
+
<dt><a href="#Cobalt">Cobalt</a></dt>
|
|
58
|
+
<dd><p>Cobalt Frontend SDK</p>
|
|
59
|
+
</dd>
|
|
60
|
+
</dl>
|
|
61
|
+
|
|
62
|
+
## Typedefs
|
|
63
|
+
|
|
64
|
+
<dl>
|
|
65
|
+
<dt><a href="#Label">Label</a> : <code>Object</code></dt>
|
|
66
|
+
<dd><p>Field Mapping Label</p>
|
|
67
|
+
</dd>
|
|
68
|
+
<dt><a href="#DynamicField">DynamicField</a> : <code>Object</code></dt>
|
|
69
|
+
<dd><p>Field Mapping Label</p>
|
|
70
|
+
</dd>
|
|
71
|
+
<dt><a href="#DynamicFields">DynamicFields</a> : <code>Object</code></dt>
|
|
72
|
+
<dd><p>The dynamic fields payload.</p>
|
|
73
|
+
</dd>
|
|
74
|
+
<dt><a href="#Config">Config</a> : <code>Object</code></dt>
|
|
75
|
+
<dd><p>The configuration data for an application.</p>
|
|
76
|
+
</dd>
|
|
77
|
+
<dt><a href="#Workflow">Workflow</a> : <code>Object</code></dt>
|
|
78
|
+
<dd><p>The workflow.</p>
|
|
79
|
+
</dd>
|
|
80
|
+
</dl>
|
|
81
|
+
|
|
82
|
+
<a name="Cobalt"></a>
|
|
83
|
+
|
|
84
|
+
## Cobalt
|
|
85
|
+
Cobalt Frontend SDK
|
|
86
|
+
|
|
87
|
+
**Kind**: global class
|
|
88
|
+
|
|
89
|
+
* [Cobalt](#Cobalt)
|
|
90
|
+
* [new Cobalt(options)](#new_Cobalt_new)
|
|
91
|
+
* [.connect(slug, [payload])](#Cobalt+connect) ⇒ <code>Promise.<Boolean></code>
|
|
92
|
+
* [.disconnect(slug)](#Cobalt+disconnect) ⇒ <code>Promise.<void></code>
|
|
93
|
+
* [.config(slug, configId, [fields])](#Cobalt+config) ⇒ [<code>Promise.<Config></code>](#Config)
|
|
94
|
+
* [.updateConfig(slug, configId, payload)](#Cobalt+updateConfig) ⇒ [<code>Promise.<Config></code>](#Config)
|
|
95
|
+
* [.deleteConfig(slug, configId)](#Cobalt+deleteConfig) ⇒ <code>Promise.<unknown></code>
|
|
96
|
+
* Additional Methods:
|
|
97
|
+
* [.getApp(slug)](#Cobalt+getApp) ⇒ <code>Promise.<Application></code>
|
|
98
|
+
* [.getConfig(slug, configId)](#Cobalt+getConfig) ⇒ [<code>Promise.<Config></code>](#Config)
|
|
99
|
+
|
|
100
|
+
<a name="new_Cobalt_new"></a>
|
|
101
|
+
|
|
102
|
+
### new Cobalt(options)
|
|
103
|
+
Cobalt Frontend SDK
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
| Param | Type | Default | Description |
|
|
107
|
+
| --- | --- | --- | --- |
|
|
108
|
+
| options | <code>Object</code> | | The options to configure the Cobalt SDK. |
|
|
109
|
+
| [options.token] | <code>String</code> | | The session token. |
|
|
110
|
+
| [options.baseUrl] | <code>String</code> | <code>https://api.gocobalt.io</code> | The base URL of the Cobalt API. |
|
|
111
|
+
|
|
112
|
+
<a name="Cobalt+getApp"></a>
|
|
113
|
+
|
|
114
|
+
### cobalt.getApp(slug) ⇒ <code>Promise.<Application></code>
|
|
115
|
+
Returns the application details for the specified application, provided
|
|
116
|
+
the application is enabled in Cobalt.
|
|
117
|
+
|
|
118
|
+
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
119
|
+
**Returns**: <code>Promise.<Application></code> - The application details.
|
|
120
|
+
|
|
121
|
+
| Param | Type | Description |
|
|
122
|
+
| --- | --- | --- |
|
|
123
|
+
| slug | <code>String</code> | The application slug. |
|
|
124
|
+
|
|
125
|
+
<a name="Cobalt+connect"></a>
|
|
126
|
+
|
|
127
|
+
### cobalt.connect(slug, [payload]) ⇒ <code>Promise.<Boolean></code>
|
|
128
|
+
Connect the specified application, optionally with the auth data that user provides.
|
|
129
|
+
|
|
130
|
+
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
131
|
+
**Returns**: <code>Promise.<Boolean></code> - Whether the connection was successful.
|
|
132
|
+
|
|
133
|
+
| Param | Type | Default | Description |
|
|
134
|
+
| --- | --- | --- | --- |
|
|
135
|
+
| slug | <code>String</code> | | The application slug. |
|
|
136
|
+
| [payload] | <code>Object.<string, (string\|number\|boolean)></code> | <code>{}</code> | The key value pairs of auth data. |
|
|
137
|
+
|
|
138
|
+
<a name="Cobalt+disconnect"></a>
|
|
139
|
+
|
|
140
|
+
### cobalt.disconnect(slug) ⇒ <code>Promise.<void></code>
|
|
141
|
+
Disconnect the specified application and remove any associated data from Cobalt.
|
|
142
|
+
|
|
143
|
+
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
144
|
+
|
|
145
|
+
| Param | Type | Description |
|
|
146
|
+
| --- | --- | --- |
|
|
147
|
+
| slug | <code>String</code> | The application slug. |
|
|
148
|
+
|
|
149
|
+
<a name="Cobalt+config"></a>
|
|
150
|
+
|
|
151
|
+
### cobalt.config(slug, configId, [fields]) ⇒ [<code>Promise.<Config></code>](#Config)
|
|
152
|
+
Returns the specified config, or creates one if it doesn't exist.
|
|
153
|
+
|
|
154
|
+
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
155
|
+
**Returns**: [<code>Promise.<Config></code>](#Config) - The specified config.
|
|
156
|
+
|
|
157
|
+
| Param | Type | Description |
|
|
158
|
+
| --- | --- | --- |
|
|
159
|
+
| slug | <code>String</code> | The application slug. |
|
|
160
|
+
| configId | <code>String</code> | A unique ID for the config. |
|
|
161
|
+
| [fields] | [<code>DynamicFields</code>](#DynamicFields) | The dynamic fields payload. |
|
|
162
|
+
|
|
163
|
+
<a name="Cobalt+getConfig"></a>
|
|
164
|
+
|
|
165
|
+
### cobalt.getConfig(slug, configId) ⇒ [<code>Promise.<Config></code>](#Config)
|
|
166
|
+
Returns the specified config.
|
|
167
|
+
|
|
168
|
+
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
169
|
+
**Returns**: [<code>Promise.<Config></code>](#Config) - The specified config.
|
|
170
|
+
|
|
171
|
+
| Param | Type | Description |
|
|
172
|
+
| --- | --- | --- |
|
|
173
|
+
| slug | <code>String</code> | The application slug. |
|
|
174
|
+
| configId | <code>String</code> | The unique ID of the config. |
|
|
175
|
+
|
|
176
|
+
<a name="Cobalt+updateConfig"></a>
|
|
177
|
+
|
|
178
|
+
### cobalt.updateConfig(slug, configId, payload) ⇒ [<code>Promise.<Config></code>](#Config)
|
|
179
|
+
Update the specified config.
|
|
180
|
+
|
|
181
|
+
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
182
|
+
**Returns**: [<code>Promise.<Config></code>](#Config) - The specified config.
|
|
183
|
+
|
|
184
|
+
| Param | Type | Description |
|
|
185
|
+
| --- | --- | --- |
|
|
186
|
+
| slug | <code>String</code> | The application slug. |
|
|
187
|
+
| configId | <code>String</code> | The unique ID of the config. |
|
|
188
|
+
| payload | [<code>Config</code>](#Config) | The update payload. |
|
|
189
|
+
|
|
190
|
+
<a name="Cobalt+deleteConfig"></a>
|
|
191
|
+
|
|
192
|
+
### cobalt.deleteConfig(slug, configId) ⇒ <code>Promise.<unknown></code>
|
|
193
|
+
Delete the specified config.
|
|
194
|
+
|
|
195
|
+
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
196
|
+
|
|
197
|
+
| Param | Type | Description |
|
|
198
|
+
| --- | --- | --- |
|
|
199
|
+
| slug | <code>String</code> | The application slug. |
|
|
200
|
+
| configId | <code>String</code> | The unique ID of the config. |
|
|
201
|
+
|
|
202
|
+
<a name="Label"></a>
|
|
203
|
+
|
|
204
|
+
## Label : <code>Object</code>
|
|
205
|
+
Field Mapping Label
|
|
206
|
+
|
|
207
|
+
**Kind**: global typedef
|
|
208
|
+
**Properties**
|
|
209
|
+
|
|
210
|
+
| Name | Type | Description |
|
|
211
|
+
| --- | --- | --- |
|
|
212
|
+
| name | <code>string</code> | The Label name. |
|
|
213
|
+
| value | <code>string</code> \| <code>number</code> \| <code>boolean</code> | The Label value. |
|
|
214
|
+
|
|
215
|
+
<a name="DynamicField"></a>
|
|
216
|
+
|
|
217
|
+
## DynamicField : <code>Object</code>
|
|
218
|
+
Field Mapping Label
|
|
219
|
+
|
|
220
|
+
**Kind**: global typedef
|
|
221
|
+
**Properties**
|
|
222
|
+
|
|
223
|
+
| Name | Type | Description |
|
|
224
|
+
| --- | --- | --- |
|
|
225
|
+
| fields | [<code>Array.<Label></code>](#Label) | The Label name. |
|
|
226
|
+
|
|
227
|
+
<a name="DynamicFields"></a>
|
|
228
|
+
|
|
229
|
+
## DynamicFields : <code>Object</code>
|
|
230
|
+
The dynamic fields payload.
|
|
231
|
+
|
|
232
|
+
**Kind**: global typedef
|
|
233
|
+
**Properties**
|
|
234
|
+
|
|
235
|
+
| Name | Type | Description |
|
|
236
|
+
| --- | --- | --- |
|
|
237
|
+
| map_fields_object | <code>Object.<string, DynamicField></code> | desc. |
|
|
238
|
+
|
|
239
|
+
<a name="Config"></a>
|
|
240
|
+
|
|
241
|
+
## Config : <code>Object</code>
|
|
242
|
+
The configuration data for an application.
|
|
243
|
+
|
|
244
|
+
**Kind**: global typedef
|
|
245
|
+
**Properties**
|
|
246
|
+
|
|
247
|
+
| Name | Type | Description |
|
|
248
|
+
| --- | --- | --- |
|
|
249
|
+
| [config_id] | <code>String</code> | Unique ID for the config. |
|
|
250
|
+
| application_data_slots | <code>Object.<string, (string\|number\|boolean)></code> | A map of application data slots and their values. |
|
|
251
|
+
| workflows | [<code>Array.<Workflow></code>](#Workflow) | Whether the workflow is enabled. |
|
|
252
|
+
|
|
253
|
+
<a name="Workflow"></a>
|
|
254
|
+
|
|
255
|
+
## Workflow : <code>Object</code>
|
|
256
|
+
The workflow.
|
|
257
|
+
|
|
258
|
+
**Kind**: global typedef
|
|
259
|
+
**Properties**
|
|
260
|
+
|
|
261
|
+
| Name | Type | Description |
|
|
262
|
+
| --- | --- | --- |
|
|
263
|
+
| id | <code>String</code> | The ID of the workflow. |
|
|
264
|
+
| enabled | <code>Boolean</code> | Whether the workflow is enabled. |
|
|
265
|
+
| data_slots | <code>Object.<string, (string\|number\|boolean)></code> | A map of workflow's data slots and their values. |
|
package/cobalt.js
CHANGED
|
@@ -24,7 +24,6 @@ class Cobalt {
|
|
|
24
24
|
/**
|
|
25
25
|
* Returns the application details for the specified application, provided
|
|
26
26
|
* the application is enabled in Cobalt.
|
|
27
|
-
* @private
|
|
28
27
|
* @param {String} slug The application slug.
|
|
29
28
|
* @returns {Promise<Application>} The application details.
|
|
30
29
|
*/
|
package/docs.md
CHANGED
|
@@ -35,6 +35,7 @@ Cobalt Frontend SDK
|
|
|
35
35
|
|
|
36
36
|
* [Cobalt](#Cobalt)
|
|
37
37
|
* [new Cobalt(options)](#new_Cobalt_new)
|
|
38
|
+
* [.getApp(slug)](#Cobalt+getApp) ⇒ <code>Promise.<Application></code>
|
|
38
39
|
* [.connect(slug, [payload])](#Cobalt+connect) ⇒ <code>Promise.<Boolean></code>
|
|
39
40
|
* [.disconnect(slug)](#Cobalt+disconnect) ⇒ <code>Promise.<void></code>
|
|
40
41
|
* [.config(slug, configId, [fields])](#Cobalt+config) ⇒ [<code>Promise.<Config></code>](#Config)
|
|
@@ -54,6 +55,19 @@ Cobalt Frontend SDK
|
|
|
54
55
|
| [options.token] | <code>String</code> | | The session token. |
|
|
55
56
|
| [options.baseUrl] | <code>String</code> | <code>https://api.gocobalt.io</code> | The base URL of the Cobalt API. |
|
|
56
57
|
|
|
58
|
+
<a name="Cobalt+getApp"></a>
|
|
59
|
+
|
|
60
|
+
### cobalt.getApp(slug) ⇒ <code>Promise.<Application></code>
|
|
61
|
+
Returns the application details for the specified application, provided
|
|
62
|
+
the application is enabled in Cobalt.
|
|
63
|
+
|
|
64
|
+
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
65
|
+
**Returns**: <code>Promise.<Application></code> - The application details.
|
|
66
|
+
|
|
67
|
+
| Param | Type | Description |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| slug | <code>String</code> | The application slug. |
|
|
70
|
+
|
|
57
71
|
<a name="Cobalt+connect"></a>
|
|
58
72
|
|
|
59
73
|
### cobalt.connect(slug, [payload]) ⇒ <code>Promise.<Boolean></code>
|
package/package.json
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@cobaltio/cobalt-js",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "Cobalt frontend SDK",
|
|
5
|
-
"main": "./cobalt.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"docgen": "jsdoc2md cobalt.js > docs.md",
|
|
8
|
-
"test": "echo \"Warn: no test specified\""
|
|
9
|
-
},
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/Breakout-Embed/cobalt.js.git"
|
|
13
|
-
},
|
|
14
|
-
"publishConfig": {
|
|
15
|
-
"access": "public",
|
|
16
|
-
"registry": "https://registry.npmjs.org/"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [
|
|
19
|
-
"cobalt embed",
|
|
20
|
-
"cobalt sdk",
|
|
21
|
-
"frontend sdk",
|
|
22
|
-
"sdk"
|
|
23
|
-
],
|
|
24
|
-
"author": "Sankarsan Kampa",
|
|
25
|
-
"license": "MIT",
|
|
26
|
-
"bugs": {
|
|
27
|
-
"url": "https://github.com/Breakout-Embed/cobalt-js/issues"
|
|
28
|
-
},
|
|
29
|
-
"homepage": "https://github.com/Breakout-Embed/cobalt-js#readme",
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"jsdoc": "^4.0.2",
|
|
32
|
-
"jsdoc-to-markdown": "^8.0.0"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@cobaltio/cobalt-js",
|
|
3
|
+
"version": "3.0.1",
|
|
4
|
+
"description": "Cobalt frontend SDK",
|
|
5
|
+
"main": "./cobalt.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"docgen": "jsdoc2md cobalt.js > docs.md",
|
|
8
|
+
"test": "echo \"Warn: no test specified\""
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/Breakout-Embed/cobalt.js.git"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public",
|
|
16
|
+
"registry": "https://registry.npmjs.org/"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"cobalt embed",
|
|
20
|
+
"cobalt sdk",
|
|
21
|
+
"frontend sdk",
|
|
22
|
+
"sdk"
|
|
23
|
+
],
|
|
24
|
+
"author": "Sankarsan Kampa",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/Breakout-Embed/cobalt-js/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/Breakout-Embed/cobalt-js#readme",
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"jsdoc": "^4.0.2",
|
|
32
|
+
"jsdoc-to-markdown": "^8.0.0"
|
|
33
|
+
}
|
|
34
|
+
}
|