Identity

envless.me.get()

Read the identity behind the API key

ts
get(options?: RequestScope): Promise<IdentityResource>

Resolves the user the key belongs to, the workspace it is bound to, and a summary of the key itself. This is the only method that needs no scope, so it works with any valid key and is the cheapest way to check that a credential is still live.

Use it at startup to discover workspaceId, which you need for every encryption and decryption call. A key is permanently bound to one workspace, so this value never changes for a given key and is safe to cache for the process lifetime.

Example

ts
const identity = await envless.me.get()

console.log(identity.user.email)
console.log(identity.workspaceId)

Parameters

ParameterTypeRequiredDescription
options.signalAbortSignalNoCancels the request.

Returns

IdentityResource with user, workspaceId and key.

Worth knowing

  • key is null only when the request was authenticated by something other than an API key.
  • A failure here means the credential itself is bad. Every other method would fail the same way.

Required scopes

None. Any valid API key can call this.

Underlying endpoint

GET /me

Request and response schema, every error code, and a live playground.

In Python

envless.me.get()

The same method in envless-sdk, the Python SDK, with the same request, retries and errors.

In Ruby

Envless.me.get

The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.

In PHP

$envless->me->get()

The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.