We’ve migrated our documentation to a new site, which means some URLs have changed.
Subscriptions

How to create a user via the Piano API when using Piano Identity linking?

Though it's technically feasible, users should not be created via the Piano API because this is reserved only for Identity Management or Management + Billing accounts. Since you are using Piano Identity Linking, you would want to create a user by passing the JWT.

It’s not possible to create users in the SDK with JWT and you cannot use any available Piano API calls for user creation either. The best feasible option is to create users via the web using JWT.

They can either register themselves or as an alternative, if you want to create users globally from some list of users, you will still need to create a JWT for each of them on an HTML page with our integration script that will be running so they would be detected by our system and created in the dashboard.

For example:

tp = window.tp || [];
tp.push(["setUseTinypassAccounts", false]);
tp.push(["setUsePianoIdUserProvider", false ]);
tp.push(["setUsePianoIdLiteUserProvider", true ]);

jwtTokens = ["token1", "token2", "token3"];

for (let i = 0; i < jwtTokens.length; i++) {
  tp.push(["setExternalJWT", jwtTokens[i]]);
}

Please note, that each email address provided via the JWT needs to be unique. It is not possible to create two users with the same email address.

Last updated: