pebble
  • Tutorials
  • Get the SDK
  • Guides
  • Documentation
  • PebbleOS
  • Mobile App
  • Examples
  • Index 01
  • Community
  • Blog
  • More
Privacy
Cookies
Publish

Guides

  • Table of Contents
  • Alloy
  • Building with AI Agents
  • App Resources
  • Appstore Publishing
  • Best Practices
  • Communication
  • Debugging
  • Design and Interaction
  • Events and Services
  • Graphics and Animations
  • Pebble Packages
  • Pebble Timeline
  • Plugins (Preview)
    • Pebble Plugins Preview
    • Publishing Plugins
  • Tools and Resources
  • User Interfaces

Publishing Plugins

Publish a plugin

Run pebble publish in the plugin's project, the same way as for an app (see Publishing an App):

$ pebble login
$ pebble publish

The first time, the command creates the plugin's listing: it asks for a name, a description and a plugin category. Plugins have no screenshots. Pass --icon-small and --icon-large, or let the appstore generate a line icon from the description. Later runs upload a new release to the same listing.

From the Developer Dashboard

Plugins can also be submitted from the web, the same way as apps (see Publishing an App):

  • Open the Developer Dashboard and click New Plugin.

  • Upload the plugin's .pbw. It must have a plugin block and no watch binary. The dashboard shows the plugin's category, read from its manifest, and the permissions and OAuth connectors it declares.

  • Enter the App Name and Description, and upload the Small Icon and Large Icon or leave them empty to have a line icon generated.

  • Click Submit App. A plugin that declares OAuth connectors goes on to connector setup (see Sign users in with OAuth).

To release a new version, open the plugin in the dashboard and click New Release.

Sign users in with OAuth

A plugin that calls an API on the user's behalf can sign them in to it without shipping your client secret in the .pbw. The appstore keeps the secret and runs the token exchange; the plugin only receives the user's tokens.

  1. Declare a connector in package.json, under pebble.plugin, with a slug of your choice:

    "oauth": { "my-service": {} }
    
  2. Register an OAuth app with the service and set its redirect URI to:

    https://appstore-api.repebble.com/api/oauth/broker/callback
    
  3. Give the appstore the service's settings. pebble publish offers to do this after uploading; to do it later, or to change them:

    $ pebble oauth-connector set --slug my-service
    

    It asks for the authorization URL, token URL, scopes, client ID and client secret. The same settings are on the plugin's OAuth connector page in the Developer Dashboard.

  4. In the plugin, start the sign-in and keep the tokens in secure storage:

    var tokens = await Pebble.oauth.authorize('my-service');
    await Pebble.secureStorage.setItem('access_token', tokens.access_token);
    

    tokens has access_token and, when the service issues a refresh token, broker_refresh. When the access token expires, pass broker_refresh to Pebble.oauth.refresh('my-service', brokerRefresh) for a new one.

authorize also works on the emulator: it opens the service's sign-in page in your browser, signed in as your pebble login account. The connector must be set up first.

You need JavaScript enabled to read and post comments.

Overview

  • Publish a plugin
  • From the Developer Dashboard
  • Sign users in with OAuth