bytex-sdk 1.7.0 → 1.7.2

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/index.js +30 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -23,7 +23,20 @@ export class BytexCloud {
23
23
  if (this.provider === 'supabase') {
24
24
  const url = config.supabaseUrl || SUPABASE_URL;
25
25
  const key = config.supabaseKey || SUPABASE_ANON_KEY;
26
- this.supabase = createClient(url, key);
26
+
27
+ // Add custom storage support for React Native
28
+ const supabaseConfig = {
29
+ auth: {
30
+ persistSession: true,
31
+ autoRefreshToken: true,
32
+ detectSessionInUrl: false
33
+ }
34
+ };
35
+ if (config.storage) {
36
+ supabaseConfig.auth.storage = config.storage;
37
+ }
38
+
39
+ this.supabase = createClient(url, key, supabaseConfig);
27
40
  } else if (this.provider === 'firebase') {
28
41
  this.fbProjectId = config.fbProjectId;
29
42
  this.fbApiKey = config.fbApiKey;
@@ -35,6 +48,22 @@ export class BytexCloud {
35
48
  this._projectScope = 'production';
36
49
  }
37
50
 
51
+ /**
52
+ * Dynamically update infrastructure settings (BYOC).
53
+ * @param {object} config - { supabaseUrl, supabaseKey, workerUrl, dbProvider }
54
+ */
55
+ configure(config = {}) {
56
+ if (config.workerUrl) this.workerUrl = config.workerUrl;
57
+ if (config.dbProvider) this.provider = config.dbProvider;
58
+
59
+ if (this.provider === 'supabase' && (config.supabaseUrl || config.supabaseKey)) {
60
+ const url = config.supabaseUrl || this.supabase.supabaseUrl;
61
+ const key = config.supabaseKey || this.supabase.supabaseKey;
62
+ this.supabase = createClient(url, key);
63
+ }
64
+ console.log('[ByteX SDK] Configuration updated.');
65
+ }
66
+
38
67
  // ─────────────────────────────────────────────
39
68
  // SECTION 1: AUTHENTICATION
40
69
  // ─────────────────────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bytex-sdk",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {