Authentication
Session management and authentication state. Login, logout, and credential inspection.
4 methods
client.login()
Authenticate with email and password. Returns a session token and installs it on the client for subsequent requests.
Parameters
emailrequiredstringemailUser email address.
passwordrequiredstringUser password.
Return Fields
sessionTokenrequiredstringJWT session token for subsequent requests.
expiresAtoptionalstringdate-timeToken expiration timestamp (ISO 8601).
login(email: string, password: string): Promise<{ sessionToken: string; expiresAt?: string }>typescript
import { RegistryClient } from '@uluops/registry-sdk';
const client = new RegistryClient({
apiKey: 'ulr_your-api-key',
});
const result = await client.login('user@example.com', 'SecurePass123!');
console.log(result.sessionToken);Response Type
// Promise<{ sessionToken: string; expiresAt?: string }>
{
sessionToken: string;
expiresAt?: string;
}client.clearLocalSession()
Clear the session token from the client. Does not revoke the token server-side — use the ops-sdk's logout() for server-side revocation.
clearLocalSession(): voidtypescript
import { RegistryClient } from '@uluops/registry-sdk';
const client = new RegistryClient({
apiKey: 'ulr_your-api-key',
});
const result = await client.clearLocalSession();Response Type
voidclient.isAuthenticated()
Check whether the client currently holds a valid credential (API key or session token).
isAuthenticated(): booleantypescript
import { RegistryClient } from '@uluops/registry-sdk';
const client = new RegistryClient({
apiKey: 'ulr_your-api-key',
});
const result = await client.isAuthenticated();Response Type
booleanclient.getAuthType()
Get the type of credential currently configured on the client.
getAuthType(): 'api_key' | 'session' | nulltypescript
import { RegistryClient } from '@uluops/registry-sdk';
const client = new RegistryClient({
apiKey: 'ulr_your-api-key',
});
const result = await client.getAuthType();Response Type
'api_key' | 'session' | null