@ptkl/sdk 0.1.0 → 0.2.0
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 +16 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
To use the SDK, you’ll first need to generate an access token.
|
|
2
|
+
|
|
3
|
+
If you haven’t created any users or roles yet, head to the **IAM** section in the dashboard. Start by creating a [role](https://platform.protokol.io/admin/users/roles), then create a [user](https://platform.protokol.io/admin/users) and assign the appropriate role(s) to them.
|
|
4
|
+
|
|
5
|
+
Once your user is set up, go to their **API user edit page**. From there, you can generate a new secret or create a token for an existing secret by clicking the **"Generate secret"** button.
|
|
6
|
+
|
|
7
|
+
### Usage
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
const platform = new Platform({
|
|
11
|
+
token: // your generated token
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
// now you can
|
|
15
|
+
const results = await platform.function().run("hello_world", {text: "Hi!"})
|
|
16
|
+
```
|