Search by name, SuiNS, address, digest, object ID, coin type or checkpoint.

API

zklogin.import

Import the salts your users already have, so their addresses stay the same.

Details

Endpoint
POST /v1/zklogin/import
Credits
Free
Rate class
Light. Counts against your light requests per second.

For apps moving existing zkLogin users to tide. Send up to 1,000 users per call for one client id, each as { subHash, salt } (subHash = hex SHA-256 of the user's sub) or { sub, salt }, or one user as { jwt, salt }. Imported salts are encrypted at rest and win over tide's own salt from then on. The client id must be registered to your key with a sign-in token (verified). A user who already has a different salt here, or who already got tide's own salt, is skipped unless replace is true, because their address would change. Free.

Parameters

NameTypeDescription
clientIdstringThe OAuth client id (aud) these users signed in with. Not needed with jwt.
usersarray of objectUsers to import.Up to 1000 items.
users[].substring
users[].subHashstring
users[].saltstring
jwtstringOne user's ID token, instead of clientId and users.
saltstringThat user's salt (with jwt).
replacebooleanOverwrite an existing salt (changes that user's address). Default false.

Request

Send your key in the x-api-key header, or leave it out to use the keyless tier.

curl
curl -X POST "https://api.tide.ad/v1/zklogin/import" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
  "clientId": "1234567890-abc.apps.googleusercontent.com",
  "users": [
    {
      "subHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
      "salt": "129390038577185583942388216820280642146"
    }
  ]
}'
TypeScript
const res = await fetch("https://api.tide.ad/v1/zklogin/import", {
  method: "POST",
  headers: {
    "x-api-key": process.env.TIDE_API_KEY!,
    "content-type": "application/json",
  },
  body: JSON.stringify({
    "clientId": "1234567890-abc.apps.googleusercontent.com",
    "users": [
      {
        "subHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
        "salt": "129390038577185583942388216820280642146"
      }
    ]
  }),
});
const data = await res.json();

Response

JSON
{
  "imported": 1,
  "unchanged": 0,
  "replaced": 0,
  "skipped": [],
  "total": 1
}