Installation
We provide SDKs for developing projects in: NodeJS, Go, React Native (Android and iOS) and Web projects (both websites and browser extensions).
NodeJS, React Native and Web
To use the SDK in an existing project you simply need to:
Obtain an NPM auth token and an
API_KEY
from the Sodot team.Create a
.npmrc
file in your project's root directory (the same directory as yourpackage.json
file).
Then, copy and paste the following as-is into your.npmrc
:
@sodot:registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
- Add the npm token as an environment variable, e.g. in a terminal session run:
export NPM_TOKEN="npm_<YOUR_TOKEN>"
- Add it to your project:
- Node
- Web
- React Native
$ yarn add @sodot/sodot-node-sdk
$ yarn add @sodot/sodot-web-sdk
$ yarn add @sodot/sodot-react-native-sdk
# Due to limitations in React Native this must also be explicitly added to any project using the SDK.
$ yarn add react-native-encrypted-storage react-native-get-random-values
$ npx pod-install
You can now start generating keys and signing.
Go
To use the SDK in an existing project you simply need to:
Obtain a Github access token and an
API_KEY
from the Sodot team.Set the following environment variable, e.g. in a terminal session run:
export GOPRIVATE=github.com/sodot-rs/sodot-go-sdk
- Set your Github credentials for the Go SDK to use your Github access token:
git config --global url."https://none:github_pat_<YOUR_TOKEN>@github.com/sodot-rs/sodot-go-sdk".insteadOf "https://github.com/sodot-rs/sodot-go-sdk"
- Add it to your project:
go get github.com/sodot-rs/sodot-go-sdk
You can now start generating keys and signing.