@dogeos/dogeos-sdk 4.0.0-beta.9 → 4.0.1
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.
- package/README.md +14 -13
- package/dist/dogeos-sdk.css +1 -1
- package/dist/index.d.ts +254 -0
- package/dist/index.js +14763 -14325
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -17,13 +17,9 @@ The npm package is built with deployment-owned public service destinations. The
|
|
|
17
17
|
- `DOGEOS_EMBEDDED_WALLET_STAGE`
|
|
18
18
|
- `DOGEOS_SDK_AUTH_SERVICE_ORIGINS` (comma-separated gateway/service origins)
|
|
19
19
|
|
|
20
|
-
The build fails when any required value is missing or invalid. These values are compiled into the published SDK and are not consumer provider options.
|
|
20
|
+
The build fails when any required value is missing or invalid. These values are compiled into the published SDK and are not consumer provider options.
|
|
21
21
|
|
|
22
|
-
The SDK directory is a library-only package.
|
|
23
|
-
its Vite entrypoint and application tests live in
|
|
24
|
-
[`apps/sdk-demo`](../../apps/sdk-demo/README.md). Use `pnpm watch:demo` from the
|
|
25
|
-
repository root for the supported SDK-and-app development loop; the app still
|
|
26
|
-
resolves this package through its public `dist` export.
|
|
22
|
+
The SDK directory is a library-only package. Consumers resolve it through its public `dist` export.
|
|
27
23
|
|
|
28
24
|
## Installation
|
|
29
25
|
|
|
@@ -167,7 +163,7 @@ export function SignMessageButton() {
|
|
|
167
163
|
|
|
168
164
|
### 5. Sign In with Wallet (SIW)
|
|
169
165
|
|
|
170
|
-
|
|
166
|
+
`signInWithWallet` constructs a message and returns its signature. It does not create a server session or return an authentication token. For EVM wallets it constructs an ERC-4361 (SIWE) message using the connected address and decimal chain ID. Supply your server-issued nonce and issuedAt, together with the expected domain and URI, so your server can reconstruct and verify the challenge. The helper preserves nonce and URI, normalizes issuedAt to ISO UTC, and signs the constructed bytes unchanged. A supplied address or chain ID must match the connected wallet. If your server already returns the complete message, use `signMessage({ message })` to sign those exact bytes instead.
|
|
171
167
|
|
|
172
168
|
```tsx
|
|
173
169
|
// SignInButton.tsx
|
|
@@ -179,7 +175,9 @@ export function SignInButton() {
|
|
|
179
175
|
|
|
180
176
|
const handleSignIn = async () => {
|
|
181
177
|
try {
|
|
182
|
-
|
|
178
|
+
// Your server creates and retains these SIWE fields, including nonce and issuedAt.
|
|
179
|
+
const challenge = await fetchSignInChallenge(address);
|
|
180
|
+
const proof = await signInWithWallet(challenge);
|
|
183
181
|
// Send the short-lived proof directly to your backend. Never log it or persist it in localStorage.
|
|
184
182
|
await sendProofToBackend(proof);
|
|
185
183
|
} catch (error) {
|
|
@@ -195,6 +193,8 @@ export function SignInButton() {
|
|
|
195
193
|
}
|
|
196
194
|
```
|
|
197
195
|
|
|
196
|
+
`fetchSignInChallenge` and `sendProofToBackend` above are application callbacks, not SDK endpoints. The server must verify the signature and expected challenge fields before creating a session. Version 4.0.1 corrects the EVM helper's previously nonstandard message format; custom verifiers that reconstructed the old text must adopt the SIWE format. No legacy-format fallback is performed.
|
|
197
|
+
|
|
198
198
|
## Configuration
|
|
199
199
|
|
|
200
200
|
`WalletConnectProvider` accepts a `config` prop to customize the SDK's behavior.
|
|
@@ -299,11 +299,12 @@ export function App() {
|
|
|
299
299
|
}
|
|
300
300
|
```
|
|
301
301
|
|
|
302
|
-
Provider credentials
|
|
303
|
-
|
|
304
|
-
controls and provide their registered DogeOS client ID. A successful SDK
|
|
305
|
-
continues to the associated embedded wallet automatically; returning
|
|
306
|
-
connections are restored by the provider without consumer session
|
|
302
|
+
Provider OAuth client IDs and credentials are owned by the DogeOS authentication
|
|
303
|
+
authority for each environment. Consumer applications select the enabled login
|
|
304
|
+
controls and provide only their registered DogeOS client ID. A successful SDK
|
|
305
|
+
login continues to the associated embedded wallet automatically; returning
|
|
306
|
+
wallet connections are restored by the provider without consumer session
|
|
307
|
+
plumbing.
|
|
307
308
|
|
|
308
309
|
### Configure Theme
|
|
309
310
|
|