How to install the Trust Stack SDK, get access to the API, and start building with Trust Stack.
To get started, install the Trust Stack SDK.
The Trust Stack SDK is also available as a set of NPM packages to keep your codebase clean and focused. Read more about modules to learn more.
Each core functionality is either available per the TrustStack
client in @truststack/sdk
or as a module in the @truststack/<MODULE>
package.
Or, alternatively, via only installing the @truststack/admin
:
You can configure the SDK globally and set your access token.
Subsequent module usage will use the access token you have configured. Below is an example of how to use the Canvas module.
You can also configure globally with each module as well. The following examples all have the same effect.
You can also set the access token via environment variables.
It is recommended you read about Organizations before continuing.
Most actions within the Trust Stack require the concept of a “Organization”. The Organizations section has more information but setting the organization is important to ensure your requests are made in the correct context.
It enforces permissions and authorization for the actions you perform on hehalf of your user groups.
There are a few ways to set the organization.
You can set the organization globally:
You can also set the organization on a per client basis.
You can also set the organization on a per request basis. Most module functions accept a second set of parameters to do this.
If you don’t set an organization, the SDK will default your tenant as the organization. If you are require DIDs, Credentials, or other resources, you will need to set the organization. managed against your tenant, this is the default behavior.
How to install the Trust Stack SDK, get access to the API, and start building with Trust Stack.
To get started, install the Trust Stack SDK.
The Trust Stack SDK is also available as a set of NPM packages to keep your codebase clean and focused. Read more about modules to learn more.
Each core functionality is either available per the TrustStack
client in @truststack/sdk
or as a module in the @truststack/<MODULE>
package.
Or, alternatively, via only installing the @truststack/admin
:
You can configure the SDK globally and set your access token.
Subsequent module usage will use the access token you have configured. Below is an example of how to use the Canvas module.
You can also configure globally with each module as well. The following examples all have the same effect.
You can also set the access token via environment variables.
It is recommended you read about Organizations before continuing.
Most actions within the Trust Stack require the concept of a “Organization”. The Organizations section has more information but setting the organization is important to ensure your requests are made in the correct context.
It enforces permissions and authorization for the actions you perform on hehalf of your user groups.
There are a few ways to set the organization.
You can set the organization globally:
You can also set the organization on a per client basis.
You can also set the organization on a per request basis. Most module functions accept a second set of parameters to do this.
If you don’t set an organization, the SDK will default your tenant as the organization. If you are require DIDs, Credentials, or other resources, you will need to set the organization. managed against your tenant, this is the default behavior.