The SDK class. This is the entry point for the Crewdle SDK.

Implements

  • ISDK

Methods

  • Authenticate an agent.

    Parameters

    • credentials: IAgentCredentials

      The credentials to authenticate the agent with.

    Returns Promise<IAuthAgent>

    A promise that resolves with the authenticated agent.

  • Authenticate a user.

    Parameters

    • credentials: IUserCredentials

      The credentials to authenticate the user with.

    Returns Promise<IAuthUser>

    A promise that resolves with the authenticated user.

  • Close the SDK.

    Parameters

    • Optionaloptions: ISDKCloseOptions

    Returns Promise<void>

  • Join a cluster.

    Parameters

    • clusterId: string

      The ID of the cluster to join.

    Returns Promise<ICluster>

    A promise that resolves with the cluster.

    SDKClientErrorCodes.NodeNotAuthenticated if the node is not authenticated.

  • Get an instance of the SDK.

    Parameters

    • vendorId: string

      The ID of the vendor to access the SDK.

    • accessToken: string

      The access token to validate the access to the SDK.

    • Optionaloptions: ISDKOptions

      The options to configure the SDK.

    • OptionalsecretKey: string

      The secret key to use for the SDK when calling from a server.

    Returns Promise<ISDK>

    An instance of the SDK.

  • Get if the SDK is running in production mode.

    Returns boolean

  • Get the current estimated server timestamp.

    Returns Promise<number>