@sigx/lynx-maps 0.4.1 → 0.4.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.
package/README.md CHANGED
@@ -80,30 +80,35 @@ Google Maps requires an API key. Get one at
80
80
  [console.cloud.google.com](https://console.cloud.google.com/) → APIs &
81
81
  Services → Credentials → "Maps SDK for Android".
82
82
 
83
- Once you have a key, add the standard meta-data block inside
84
- `<application>` in `android/app/src/main/AndroidManifest.xml`:
85
-
86
- ```xml
87
- <meta-data
88
- android:name="com.google.android.geo.API_KEY"
89
- android:value="@string/google_maps_api_key" />
83
+ Set it in `signalx.config.ts` under `android.googleMapsApiKey`. Prebuild
84
+ injects the required `com.google.android.geo.API_KEY` meta-data into the
85
+ generated `AndroidManifest.xml` for you — **don't hand-edit the manifest**, it's
86
+ a managed file that every `sigx prebuild` regenerates.
87
+
88
+ ```ts
89
+ // signalx.config.ts
90
+ export default defineLynxConfig({
91
+ // …
92
+ android: {
93
+ // Read from the environment so the key never lands in source control.
94
+ // (signalx.config.ts is evaluated at prebuild time, so process.env works.)
95
+ googleMapsApiKey: process.env.GOOGLE_MAPS_API_KEY,
96
+ },
97
+ });
90
98
  ```
91
99
 
92
- …and define the string in `android/app/src/main/res/values/strings.xml`:
93
-
94
- ```xml
95
- <resources>
96
- <!-- existing entries -->
97
- <string name="google_maps_api_key" translatable="false">YOUR_KEY_HERE</string>
98
- </resources>
100
+ ```bash
101
+ GOOGLE_MAPS_API_KEY=AIza… pnpm sigx prebuild # or run:android / dev
99
102
  ```
100
103
 
101
- If you don't add the meta-data block, the map still renders but with
102
- Google's "For development purposes only" watermark. That's fine for early
103
- testing; ship a real key before publishing to the Play Store.
104
+ If you don't set a key, prebuild injects a placeholder and prints a warning.
105
+ The app **still launches** the map just renders blank and logs
106
+ `Authorization failure API Key: …` at runtime (it does **not** crash). Set a
107
+ real key before shipping. On `sigx-lynx-go` (the prebuilt sandbox app) the blank
108
+ map is expected — we can't bundle a per-user API key in a public binary.
104
109
 
105
- On `sigx-lynx-go` (the prebuilt sandbox app) the placeholder watermark is
106
- expected we can't bundle a per-user API key in a public binary.
110
+ > Need a manifest `<meta-data>` key that isn't covered by a dedicated config
111
+ > field? Use the generic `android.manifestMetaData` map in `signalx.config.ts`.
107
112
 
108
113
  ## Limitations (v1)
109
114
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sigx/lynx-maps",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Native map view for sigx-lynx (MKMapView on iOS, Google Maps on Android).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -23,13 +23,13 @@
23
23
  "LICENSE"
24
24
  ],
25
25
  "peerDependencies": {
26
- "@sigx/lynx": "^0.4.1"
26
+ "@sigx/lynx": "^0.4.2"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@typescript/native-preview": "7.0.0-dev.20260521.1",
30
30
  "typescript": "^6.0.3",
31
31
  "vitest": "^4.1.7",
32
- "@sigx/lynx": "^0.4.1"
32
+ "@sigx/lynx": "^0.4.2"
33
33
  },
34
34
  "author": "Andreas Ekdahl",
35
35
  "license": "MIT",
@@ -25,6 +25,14 @@
25
25
  ],
26
26
  "dependencies": [
27
27
  "com.google.android.gms:play-services-maps:19.0.0"
28
+ ],
29
+ "metaData": [
30
+ {
31
+ "name": "com.google.android.geo.API_KEY",
32
+ "valueFrom": "android.googleMapsApiKey",
33
+ "default": "MISSING_GOOGLE_MAPS_API_KEY",
34
+ "helpUrl": "https://developers.google.com/maps/documentation/android-sdk/get-api-key"
35
+ }
28
36
  ]
29
37
  }
30
38
  }