Installation and usage

The Tanker Identity SDK is available on GitHub

You can include it in your application:

import (
    "github.com/TankerHQ/identity-go/identity"
)

Identity configuration

This a struct used to represent your Tanker app in the SDK.

type Config struct { 
    AppID     string 
    AppSecret string 
} 
Parameters
AppID: string The app ID, you can access it from the Tanker dashboard
AppSecret: string The app secret, secret that you have saved right after the creation of your app

Create identity

Create a new Tanker identity. This identity is secret and must only be given to a user who has been authenticated by your application. This identity is used by the Tanker client SDK to open a Tanker session.

Create(config Config, userID string) (*string, error)
Parameters
config: Config A struct representing your Tanker app
userID: string The unique ID of a user in your application
Returns
*string An identity

Provisional identity

Create a Tanker provisional identity. It allows you to share a resource with a user who does not have an account in your application yet. It must be served to an authenticated user, and attached client-side to access the resource. You will need to verifiy the associated email.

CreateProvisional(config Config, email string) (*string, error)
Parameters
config: Config A struct representing your Tanker app
email: string The email associated with the provisional identity
Returns
*string A provisional identity

Public identity

Return the public identity from an identity or a provisional identity. This public identity can be used by the Tanker client SDK to share encrypted resource.

GetPublicIdentity(b64Identity string) (*string, error)
Parameters
b64Identity: string An identity or a provisional identity
Returns
*string A public identity