# Public apps without a backend

URL: https://docs.folkways.io/docs/get-started/public-apps

Connect a public, read-only page, such as a live scoreboard, with a publishable key instead of a token endpoint.

A page that only shows public data, such as a scoreboard, a status page or a live map, doesn't need a backend or a
sign-in. It uses a **publishable key**, which the Realtime API trades for an anonymous, read-only token. The key ships
inside your page, so everything it can read is public.

<Steps>
  <Step>
    ### Set up the segment [#set-up-the-segment]

    In the Console, follow [Set up in the Console](/docs/get-started/console-setup) up to the topic rule (you can skip
    the signing key). Then in the segment's **Settings**, turn on **Allow anonymous connections**.
  </Step>
  <Step>
    ### Add a publishable key [#add-a-publishable-key]

    On **Publishable keys**, choose **Add key**, name it, and set **What it may read**, e.g. `scores/>`. Copy the key.
  </Step>
  <Step>
    ### Connect and subscribe [#connect-and-subscribe]

    ```ts title="scoreboard.ts" check=public-app
    import { Folkways } from '@folkwaysio/realtime';

    declare function showScore(score: unknown): void;

    const client = new Folkways.Realtime({
      url: 'https://realtime.folkways.net',
      publishableKey: 'YOUR_PUBLISHABLE_KEY',
    });
    await client.connect();

    client.topic('scores/match-7').subscribe((msg) => showScore(msg.data));
    ```
  </Step>
</Steps>

Viewers can only read: publishable keys never grant publishing. Something still has to publish the data, usually
your own server over HTTP; see [Publish from your backend](/docs/js-sdk/server#publish-from-your-backend) and the
[live dashboard example](/docs/examples/live-dashboard).

See [Publishable keys](/docs/console/publishable-keys) for pausing, revoking and rotating keys.
