@connect-xyz/auth-js 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +4 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -56,6 +56,7 @@ import { Auth } from 'https://sdk.connect.xyz/auth-js/index.js';
56
56
  const auth = new Auth({
57
57
  jwt: 'your-jwt-token',
58
58
  env: 'production', // or 'sandbox'
59
+ theme: 'auto', // 'auto' (default), 'light', or 'dark'
59
60
  onError: ({ error, reason }) => {
60
61
  console.error('Auth error:', error, 'Reason:', reason);
61
62
  },
@@ -97,6 +98,7 @@ import { Auth, AuthConfig, ErrorData, DepositData } from '@connect/auth-js';
97
98
  const config: AuthConfig = {
98
99
  jwt: 'your-jwt-token',
99
100
  env: 'sandbox',
101
+ theme: 'dark', // 'auto' (default), 'light', or 'dark'
100
102
  onError: ({ error, reason }: ErrorData) => {
101
103
  // Handle error with type safety
102
104
  },
@@ -116,6 +118,7 @@ const auth = new Auth(config);
116
118
  | ----------- | --------------------------------- | -------- | -------------- | ---------------------------------------------- |
117
119
  | `jwt` | `string` | Yes | - | JWT token for authentication with Connect Auth |
118
120
  | `env` | `"production" \| "sandbox"` | No | `"production"` | Target environment |
121
+ | `theme` | `"auto" \| "light" \| "dark"` | No | `"auto"` | Theme mode for the interface |
119
122
  | `onError` | `({ errorCode, reason }) => void` | No | - | Callback for error events |
120
123
  | `onClose` | `() => void` | No | - | Callback when the widget is closed |
121
124
  | `onDeposit` | `({ data }) => void` | No | - | Callback for deposit received |
@@ -134,6 +137,7 @@ Creates a new Auth instance with the provided configuration.
134
137
  - `config` (AuthConfig): Configuration object
135
138
  - `jwt` (string, required): JWT token for authentication
136
139
  - `env` (string, optional): Environment - 'production' (default) or 'sandbox'
140
+ - `theme` (string, optional): Theme mode - 'auto' (default), 'light', or 'dark'
137
141
  - `onError` (function, optional): Error callback
138
142
  - `onClose` (function, optional): Close callback
139
143
  - `onDeposit` (function, optional): Deposit callback
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connect-xyz/auth-js",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",