react-native-sdk-pianoio 0.4.8 → 0.5.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.
- package/README.md +37 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -173,10 +173,17 @@ Add the following to your `AndroidManifest.xml` to enable Piano ID sign-in:
|
|
|
173
173
|
### 1. Initialize the SDK
|
|
174
174
|
|
|
175
175
|
```typescript
|
|
176
|
-
import { PianoComposer } from 'react-native-sdk-pianoio';
|
|
176
|
+
import { PianoComposer, PianoEndpoint } from 'react-native-sdk-pianoio';
|
|
177
177
|
|
|
178
|
-
// Initialize with your Piano Application ID
|
|
179
|
-
|
|
178
|
+
// Initialize with your Piano Application ID and endpoint
|
|
179
|
+
// Default: Production US
|
|
180
|
+
const composer = await PianoComposer.create('YOUR_PIANO_AID');
|
|
181
|
+
|
|
182
|
+
// Or specify a regional endpoint
|
|
183
|
+
const composer = await PianoComposer.create('YOUR_PIANO_AID', PianoEndpoint.PRODUCTION_EUROPE);
|
|
184
|
+
|
|
185
|
+
// Or use sandbox for testing
|
|
186
|
+
const composer = await PianoComposer.create('YOUR_PIANO_AID', PianoEndpoint.SANDBOX);
|
|
180
187
|
```
|
|
181
188
|
|
|
182
189
|
### 2. Configure Content & Context
|
|
@@ -317,11 +324,12 @@ console.log('SDK Status:', {
|
|
|
317
324
|
**PianoUser Object:**
|
|
318
325
|
```typescript
|
|
319
326
|
interface PianoUser {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
327
|
+
success?: boolean; // Sign-in success status
|
|
328
|
+
authenticated?: boolean; // Authentication state
|
|
329
|
+
uid?: string; // User ID
|
|
330
|
+
email?: string; // User email address
|
|
331
|
+
accessToken?: string; // OAuth access token
|
|
332
|
+
[key: string]: any; // Additional fields from Piano SDK
|
|
325
333
|
}
|
|
326
334
|
```
|
|
327
335
|
|
|
@@ -442,14 +450,30 @@ interface MultipleEventsResponse {
|
|
|
442
450
|
|
|
443
451
|
## 🔧 Advanced Usage
|
|
444
452
|
|
|
445
|
-
###
|
|
453
|
+
### Regional Endpoints
|
|
454
|
+
|
|
455
|
+
Piano supports multiple regional endpoints for data residency and performance optimization:
|
|
446
456
|
|
|
447
457
|
```typescript
|
|
448
|
-
|
|
449
|
-
|
|
458
|
+
import { PianoComposer, PianoEndpoint } from 'react-native-sdk-pianoio';
|
|
459
|
+
|
|
460
|
+
// US Production (default)
|
|
461
|
+
const composer = await PianoComposer.create('YOUR_AID', PianoEndpoint.PRODUCTION);
|
|
462
|
+
|
|
463
|
+
// Europe Production
|
|
464
|
+
const composer = await PianoComposer.create('YOUR_AID', PianoEndpoint.PRODUCTION_EUROPE);
|
|
465
|
+
|
|
466
|
+
// Australia Production
|
|
467
|
+
const composer = await PianoComposer.create('YOUR_AID', PianoEndpoint.PRODUCTION_AUSTRALIA);
|
|
468
|
+
|
|
469
|
+
// Asia-Pacific Production
|
|
470
|
+
const composer = await PianoComposer.create('YOUR_AID', PianoEndpoint.PRODUCTION_ASIA_PACIFIC);
|
|
471
|
+
|
|
472
|
+
// Sandbox (for testing)
|
|
473
|
+
const composer = await PianoComposer.create('YOUR_AID', PianoEndpoint.SANDBOX);
|
|
450
474
|
|
|
451
|
-
//
|
|
452
|
-
const composer = await PianoComposer.create('
|
|
475
|
+
// You can also use string values directly
|
|
476
|
+
const composer = await PianoComposer.create('YOUR_AID', 'production-europe');
|
|
453
477
|
```
|
|
454
478
|
|
|
455
479
|
### Handling ShowLogin Events
|