Create client and get x-api-key

Create client to use all the APIs and Wallet

πŸ”­ Guide overview

In this guide, you will create a new client of Glip. A new client is a new project inside glip. A developer can create as many clients as they like. Tokens and users from one client do not interact with another client. The best practice is to have at least 2 clients, one for testing and another for production.

πŸ“˜

A glip client is like a new project inside croak. Create 2 clients - one for dev/testing and one for production.

βš™οΈ Capabilities of a croak client

  • Use Wallet SDK: The client ID created here will be used in initializing the wallet. Docs ↗️. Glip wallet is used by 2M+ monthly active gamers. It offers ease of social login without having to remember seed phrase, self-custody and on-ramp integrations. Clients can sign up new users using this SDK.
  • Use Asset (NFT/FT) APIs: The x-api-key will be used for authorizing the endpoints. API Reference ↗️. Create smart contracts for NFTs & FTs, transfer tokens, fetch & update metadata, fetch token data.
  • User Marketplace APIs: The x-api-key will be used for authorizing the endpoints. Docs ↗️. Execute primary sales, lazy minting, secondary sales transactions, and fetch trade history.

🧱 Implementation Steps

  1. Create new client : Use admin setup api to create a new client and get the x-api-key for yourself. See API Reference for code snippets in other languages ↗️

Request

curl --request POST \
     --url https://be.namasteapis.com/blockchain/v1/admin/setup \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --data '
{
     "name": "TestCompany",
     "poc": "SomePointOfContact",
     "poc_email": "[email protected]"
}
'

Response


{
  "data": {
    "active": true,
    "id": "62a87b2cf2cae25cc4bfe491",
    "name": "TestCompany",
    "apiSecretKey": "test_key.7MnRxm7a99nhczelodl+",
    "poc": "SomePointOfContact",
    "pocEmail": "[email protected]",
    "minterWalletId": "62a87b2cf2cae25cc4bfe48f",
    "testErc20TokenDataIds": {
      "mumbai": "62a87b2cf2cae25cc4bfe493"
    }
  },
  "success": true,
  "message": "Company Created!"
}

You can try it yourself 😎 here!

  1. Save the API Key and ClientId: Take care to save the api_key and id recieved in the response. It cannot be recovered.

⚠️

X-API-KEY: Client secret

This key must be kept in private. It is the client secret. Do not leave it in your code, the best practice is to keep it in a .env file and add *.env in the .gitignore file to prevent accidentally pushing the file to github.

⚠️

Lost/leaked X-API-KEY

In case you lose the x-api-key or accidentally push it to public repo or leak it in any way, contact the croak team at [email protected], or reach out on discord as fast as possible. We will verify ownership of the key and take further actions.

One you lose the key and someone else gains access to it, it stands to reason that your relayer balance can get drained. We are setting up alerts for you in case we detect draining of relayer balance. However, rest assured, that your users' owned tokens will not be affected as our Wallet SDK is non-custodial in nature and we do not store the user's private key with us.

  1. That's it you're done 🏁 You can use the apiSecretKey above anywhere that needs x-api-key

πŸ“Œ Further queries

For any queries or guidance, join https://croak.discord.com or write to [email protected]


What’s Next