WME Sync

Sync your WME userscripts across browsers

WME Sync is a small storage service for Waze Map Editor userscripts. Script authors get a simple key/value API; editors get their script settings on every machine they edit from.

Same settings everywhere

Scripts save their settings and data to WME Sync, so they follow you between browsers and computers.

No sign-up needed

The first sync creates your username and gives you a PIN. Enter it once on each other browser — that’s it.

You stay in control

See every script’s data, download it, delete it, and revoke a browser’s access at any time.

For editors

  1. The first time a script that uses WME Sync runs, it sets up your Waze username and shows you an 8-digit PIN. Note it down.
  2. In other browsers (or other WME Sync scripts), enter that PIN when asked.
  3. Optional: create an account here and link your username with its PIN to browse and download your data, change the PIN, or sign out a browser.

For script authors

Add wme-sync-lib with @require and call WMESync.init(). It reads the editor's Waze username from the WME SDK, sets the username up on first sync (showing the editor their new PIN) or asks for the PIN in a new browser, stores the tokens with GM_setValue and refreshes them automatically.

// ==UserScript==
// @name         My WME Script
// @match        https://www.waze.com/*editor*
// @match        https://beta.waze.com/*editor*
// @require      https://sync.wmekit.com/wme-sync-lib.js
// @grant        GM_xmlhttpRequest
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        unsafeWindow
// @connect      sync.wmekit.com
// ==/UserScript==

unsafeWindow.SDK_INITIALIZED.then(async () => {
  const sdk = unsafeWindow.getWmeSdk({ scriptId: 'my-wme-script', scriptName: 'My WME Script' })
  await sdk.Events.once({ eventName: 'wme-ready' })

  // On the first call in a browser it sets up sync: new usernames get a PIN (shown to the
  // editor), existing ones are asked for theirs. Tokens are remembered after that.
  const sync = await WMESync.init({ scriptId: 'my-wme-script', sdk })

  const settings = (await sync.get('settings')) ?? { highlight: true }
  settings.lastOpened = Date.now()
  await sync.set('settings', settings)
})

Other methods: sync.getAll(), sync.remove(key), sync.setMany(entries), sync.getPin() (to show the PIN again in your settings UI). Prefer raw HTTP? See the API docs.