@oceanum/layers 0.1.1 → 0.1.3

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
@@ -185,6 +185,29 @@ The zarr archives are expected to have:
185
185
  - Dimensions: `(time, [level], latitude, longitude)`
186
186
  - One or more instance groups at the root level (optional)
187
187
 
188
+ ## Using a Proxy
189
+
190
+ If you are building a public web app, **do not expose your Datamesh token in client-side code**. Instead, put a small reverse proxy between the browser and the zarr service. The proxy injects the token server-side, so your layers need no `authHeaders` at all:
191
+
192
+ ```ts
193
+ new OceanumPcolorLayer({
194
+ id: 'wave-height',
195
+ serviceUrl: 'https://your-proxy.workers.dev', // proxy URL instead of default
196
+ // No authHeaders needed
197
+ datasource: 'oceanum_wave_glob05',
198
+ variable: 'hs',
199
+ time: '2024-01-15T00:00:00Z',
200
+ colormap: { scale: [...], domain: [...] },
201
+ });
202
+ ```
203
+
204
+ This repo includes ready-to-deploy proxy examples:
205
+
206
+ - **Cloudflare Worker**: `packages/layers/proxy/cloudflare/index.js`
207
+ - **Node/Express**: `packages/layers/proxy/express/index.js`
208
+
209
+ See the full [Proxy Guide](proxy/guide.md) for setup instructions and security considerations.
210
+
188
211
  ## Error Hooks
189
212
 
190
213
  The `onError` prop accepts per-state callbacks:
package/dist/README.md CHANGED
@@ -185,6 +185,29 @@ The zarr archives are expected to have:
185
185
  - Dimensions: `(time, [level], latitude, longitude)`
186
186
  - One or more instance groups at the root level (optional)
187
187
 
188
+ ## Using a Proxy
189
+
190
+ If you are building a public web app, **do not expose your Datamesh token in client-side code**. Instead, put a small reverse proxy between the browser and the zarr service. The proxy injects the token server-side, so your layers need no `authHeaders` at all:
191
+
192
+ ```ts
193
+ new OceanumPcolorLayer({
194
+ id: 'wave-height',
195
+ serviceUrl: 'https://your-proxy.workers.dev', // proxy URL instead of default
196
+ // No authHeaders needed
197
+ datasource: 'oceanum_wave_glob05',
198
+ variable: 'hs',
199
+ time: '2024-01-15T00:00:00Z',
200
+ colormap: { scale: [...], domain: [...] },
201
+ });
202
+ ```
203
+
204
+ This repo includes ready-to-deploy proxy examples:
205
+
206
+ - **Cloudflare Worker**: `packages/layers/proxy/cloudflare/index.js`
207
+ - **Node/Express**: `packages/layers/proxy/express/index.js`
208
+
209
+ See the full [Proxy Guide](proxy/guide.md) for setup instructions and security considerations.
210
+
188
211
  ## Error Hooks
189
212
 
190
213
  The `onError` prop accepts per-state callbacks:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oceanum/layers",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "deck.gl layers for visualising gridded data from Oceanum datamesh zarr datasets",
5
5
  "scripts": {
6
6
  "build": "vite build",
@@ -14,16 +14,18 @@
14
14
  ],
15
15
  "dependencies": {
16
16
  "@oceanum/datamesh": "^0.8.0",
17
- "@oceanum/deck-gl-grid": "^9.2.2"
17
+ "@oceanum/deck-gl-grid": "^9.2.3"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@deck.gl/core": "^9.2.0",
21
21
  "@deck.gl/layers": "^9.2.0",
22
+ "@deck.gl/geo-layers": "^9.2.0",
22
23
  "@luma.gl/core": "^9.2.0"
23
24
  },
24
25
  "devDependencies": {
25
26
  "@deck.gl/core": "^9.2.0",
26
27
  "@deck.gl/layers": "^9.2.0",
28
+ "@deck.gl/geo-layers": "^9.2.0",
27
29
  "@luma.gl/core": "^9.2.0"
28
30
  },
29
31
  "type": "module",