Using the SDK from the Server

First, make sure you've installed the Niftory SDK on your project with:

yarn add @niftory/sdk

Now use the SDK in your codebase as follows:


import { NiftoryClient } from "@niftory/sdk"


...

const client =
    new NiftoryClient({
      environmentName: process.env.ENVIRONMENT //testnet or mainnet,
      appId: process.env.CLIENT_ID,
      apiKey: process.env.API_KEY,
      clientSecret: process.env.CLIENT_SECRET,
    })

await client.createNiftoryWallet()

Note: This will create a Niftory SDK with privileged authentication using a client secret that should never be public.

Parameters

All the available methods on the NiftoryClient are documented on the API Reference.

For examples of server-side usage you can check out our sample apps using the Niftory SDK:

https://github.com/Niftory/niftory-samples

Last updated