UNPKG

magically-sdk

Version:

Official SDK for Magically - Build mobile apps with AI

35 lines (34 loc) 1.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const MagicallySDK_1 = require("./MagicallySDK"); console.log('Testing SDK authentication...\n'); // Test 1: With API key console.log('=== Test 1: SDK with API key ==='); try { const sdk1 = new MagicallySDK_1.MagicallySDK({ projectId: '03997de24fb148e2a6a0', apiUrl: 'https://meet-bream-gratefully.ngrok-free.app', apiKey: 'mg_d7d649eb1848da3027dd3cc2ebb3962933d7d053594b9a0b04847eec1e71f1c1' }); console.log('SDK1 created successfully'); console.log('SDK1 data.apiClient:', sdk1.data.apiClient); console.log('SDK1 apiClient.isEdgeEnvironment:', sdk1.data.apiClient?.isEdgeEnvironment?.()); console.log('SDK1 apiClient has apiKey:', !!sdk1.data.apiClient?.apiKey); } catch (error) { console.log('SDK1 creation failed:', error.message); } // Test 2: Without API key console.log('\n=== Test 2: SDK without API key ==='); try { const sdk2 = new MagicallySDK_1.MagicallySDK({ projectId: '03997de24fb148e2a6a0', apiUrl: 'https://meet-bream-gratefully.ngrok-free.app' }); console.log('SDK2 created successfully'); console.log('SDK2 apiClient.isEdgeEnvironment:', sdk2.data.apiClient?.isEdgeEnvironment?.()); console.log('SDK2 apiClient has apiKey:', !!sdk2.data.apiClient?.apiKey); } catch (error) { console.log('SDK2 creation failed:', error.message); }