0.0.74 • Published 10 months ago

self-sdk v0.0.74

Weekly downloads
2
License
MIT
Repository
github
Last release
10 months ago

Self TypeScript SDK

CI

The official Self SDK for TypeScript.

This SDK provides a toolset to interact with the Self network from your TypeScript code.

Installation

$ npm install self-sdk

Usage

Register Application

Before the SDK can be used you must first register an application on the Self Developer Portal. Once registered, the portal will generate credentials for the application that the SDK will use to authenticate against the Self network.

Self provides two isolated networks:

Developer Portal (production network) - Suitable for production services
Developer Portal (sandbox network) - Suitable for testing and experimentation

Register your application using one of the links above (further information).

Examples

Client Setup

async function main() {
  const selfsdk = require("self-sdk");

  const client = await selfsdk.build(
    "<application-id>",
    "<application-secret-key>",
    "random-secret-string",
    "/data",
    { env: "sandbox" },  // optional (defaults to production)
  );

  await client.start()
}

main();

Additionally, you can import the transpiled modules from dist/lib in case you have a modular library:

import authentication from "self-sdk/authentication"

Identity

The identity service provides functionality for looking up identities, devices and public keys.

Get an identity:

let identity = await client.identity().get("<self-id>")

Facts

The fact service can be used to ask for specific attested facts from an identity.

Request a fact:

let phoneNumber = await client.facts().request("<self-id>", [{ fact: "phone_number" }])

Authentication

The authentication service can be used to send an authentication challenge to a users device. The response the user sends will be signed by their identity and can be validated.

let resp = await client.authentication().request("<self-id>")

Documentation

Development

NPM Scripts

  • npm t: Run test suite
  • npm start: Run npm run build in watch mode
  • npm run test:watch: Run test suite in interactive watch mode
  • npm run test:prod: Run linting and generate coverage
  • npm run build: Generate bundles and typings, create docs
  • npm run lint: Lints code
  • npm run commit: Commit using conventional commit style (husky will tell you to use it if you haven't :wink:)
  • npm run generate-sources : Generates the valid sources based on a json file (tools/config/sources.json).

Support

Looking for help? Reach out to us at support@joinself.zendesk.com

Contributing

See Contributing.

License

See License.

0.0.73

10 months ago

0.0.74

10 months ago

0.0.71

11 months ago

0.0.72

11 months ago

0.0.70

1 year ago

0.0.67

1 year ago

0.0.68

1 year ago

0.0.69

1 year ago

0.0.64

2 years ago

0.0.65

2 years ago

0.0.66

2 years ago

0.0.63

2 years ago

0.0.62

2 years ago

0.0.60

2 years ago

0.0.61

2 years ago

0.0.59

2 years ago

0.0.56

2 years ago

0.0.57

2 years ago

0.0.58

2 years ago

0.0.51

2 years ago

0.0.52

2 years ago

0.0.53

2 years ago

0.0.54

2 years ago

0.0.55

2 years ago

0.0.50

2 years ago

0.0.49

2 years ago

0.0.45

2 years ago

0.0.46

2 years ago

0.0.47

2 years ago

0.0.48

2 years ago

0.0.44

3 years ago

0.0.42

3 years ago

0.0.43

3 years ago

0.0.41

3 years ago

0.0.40

3 years ago

0.0.39

3 years ago

0.0.38

3 years ago

0.0.37

3 years ago

0.0.36

3 years ago

0.0.35

3 years ago

0.0.34

3 years ago

0.0.33

3 years ago

0.0.30

3 years ago

0.0.31

3 years ago

0.0.32

3 years ago

0.0.29

3 years ago

0.0.20

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.23

3 years ago

0.0.24

3 years ago

0.0.25

3 years ago

0.0.16

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.19

3 years ago

0.0.26

3 years ago

0.0.27

3 years ago

0.0.28

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.9

3 years ago