A lightweight TypeScript SDK for QQuik Identity services that provides seamless identity management for your applications.
npm install @qquik-identity/coreA lightweight TypeScript SDK for QQuik Identity services that provides seamless identity management for your applications.
``bash`
npm install @qquik-identity/coreor
yarn add @qquik-identity/core
- Secure device identification
- Identity and UID retrieval
- Configurable API endpoints
- TypeScript support with full type definitions
`typescript
import { QQuikIdentity } from '@qquik-identity/core';
// Initialize with your API key
const identity = new QQuikIdentity({
apiKey: 'your-api-key'
});
// Get user identity
const getIdentity = async () => {
const identity = await identity.getIdentity();
console.log(identity);
};
// Get user UID
const getUid = async () => {
const uid = await identity.getUid();
console.log(uid);
};
`
You can also use the library directly in the browser via CDN:
`html`
`typescript
import { QQuikIdentity } from '@qquik-identity/core';
// Initialize with custom configuration
const identity = new QQuikIdentity({
baseUrl: 'https://custom-api.example.com',
apiKey: 'your-api-key',
timeout: 5000 // Optional timeout in ms
});
// Get identity with custom configuration
const getIdentity = async () => {
const identity = await identity.getIdentity();
console.log(identity);
};
`
The main class for identity operations.
#### Constructor
`typescript`
new QQuikIdentity(config?: IdentityConfig)
- config: Optional configuration objectapiKey
- : Your API key for authenticationbaseUrl
- : Optional API base URLtimeout
- : Optional request timeout in milliseconds
#### Methods
- getIdentity(): Returns a Promise with the full identity objectgetUid()
- : Returns a Promise with the user's unique identifier
`typescript`
interface IdentityObject {
uid: string;
// Additional identity properties
}
`bashInstall dependencies
yarn install
MIT