
Security News
Security Community Slams MIT-linked Report Claiming AI Powers 80% of Ransomware
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.
@tanker/identity
Advanced tools
Tanker Identity generation in JavaScript for the Tanker SDK.
The preferred way of using the component is via NPM:
npm install --save @tanker/identity
createIdentity(appId, appSecret, userId);
Create a new Tanker identity. This identity is secret and must only be given to a user who has been authenticated by your application. This identity is used by the Tanker client SDK to open a Tanker session.
appId
The app ID. You can access it from the Tanker dashboard.
appSecret
The app secret key. A secret that you have saved right after the creation of your App.
userId
The ID of a user in your application.
createProvisionalIdentity(appId, 'email', email);
Create a Tanker provisional identity. It allows you to share a resource with a user who does not have an account in your application yet.
appId
The app ID. You can access it from the Tanker dashboard.
email
The email of the potential recipient of the resource.
getPublicIdentity(tankerIdentity);
Return the public identity from an identity. This public identity can be used by the Tanker client SDK to share encrypted resource.
tankerIdentity
A Tanker identity.
The server-side code below demonstrates a typical flow to safely deliver identities to your users:
import { createIdentity } from '@tanker/identity';
// Store these configurations in a safe place
const appId = '<app-id>';
const appSecret = '<app-secret>';
// Example server-side function in which you would implement checkAuth(),
// retrieveUserIdentity() and storeUserIdentity() to use your own authentication
// and data storage mechanisms:
async function getUserIdentity(userId) {
  const isAuthenticated = checkAuth(userId);
  // Always ensure user is authenticated before returning a user identity
  if (!isAuthenticated) {
    throw new Error('unauthorized');
  }
  // Retrieve a previously stored user identity for this user
  let identity = retrieveUserIdentity(userId);
  // If not found, create a new user identity
  if (!identity) {
    identity = await createIdentity(appId, appSecret, userId);
    // Store the newly generated user identity
    storeUserIdentity(userId, identity);
  }
  // From now, the same user identity will always be returned to a given user
  return identity;
}
Read more about user identity in the Tanker guide.
FAQs
Tanker Identity SDK
We found that @tanker/identity demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.