update to new url

This commit is contained in:
goenning 2023-04-20 15:23:41 +01:00
parent 617edf8250
commit 029586a6f6
4 changed files with 9 additions and 8 deletions

3
.gitignore vendored
View file

@ -1,2 +1,3 @@
node_modules node_modules
dist dist
.DS_Store

View file

@ -2,7 +2,7 @@
# JavaScript SDK for Aptabase # JavaScript SDK for Aptabase
A tiny SDK (1 kB) to instrument your web app with Aptabase, a privacy-first analytics platform for desktop, mobile and web apps. A tiny SDK (1 kB) to instrument your web app with Aptabase, an Open Source, Privacy-First and Simple Analytics for Mobile, Desktop and Web Apps.
> 👉 **IMPORTANT** > 👉 **IMPORTANT**
> >

View file

@ -1,8 +1,8 @@
{ {
"name": "@aptabase/web", "name": "@aptabase/web",
"version": "0.0.2", "version": "0.0.3",
"private": false, "private": false,
"description": "JavaScript SDK for Aptabase: Privacy-first and simple analytics for apps", "description": "JavaScript SDK for Aptabase: Open Source, Privacy-First and Simple Analytics for Mobile, Desktop and Web Apps",
"browser": "dist/index.js", "browser": "dist/index.js",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",

View file

@ -14,9 +14,9 @@ let _sessionId = newSessionId();
let _options: AptabaseOptions | undefined; let _options: AptabaseOptions | undefined;
const regions: { [region: string]: string } = { const regions: { [region: string]: string } = {
US: "https://api-us.aptabase.com", US: "https://us.aptabase.com",
EU: "https://api-eu.aptabase.com", EU: "https://eu.aptabase.com",
DEV: "http://localhost:5251", DEV: "http://localhost:3000",
}; };
export function init(appKey: string, options?: AptabaseOptions) { export function init(appKey: string, options?: AptabaseOptions) {
@ -33,7 +33,7 @@ export function init(appKey: string, options?: AptabaseOptions) {
const region = parts[1]; const region = parts[1];
const baseUrl = regions[region] ?? regions.DEV; const baseUrl = regions[region] ?? regions.DEV;
_apiUrl = `${baseUrl}/v0/event`; _apiUrl = `${baseUrl}/api/v0/event`;
_locale = _locale =
navigator.languages && navigator.languages.length navigator.languages && navigator.languages.length