> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pocketsflow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WordPress

> Install the Pocketsflow plugin, connect your store with an API key and add products with a block or a shortcode.

The Pocketsflow plugin adds a **Pocketsflow block** and a `[pocketsflow]`
shortcode to WordPress. Each one renders a buy button, a link or a product card
that opens your Pocketsflow checkout on top of the page.

Requires WordPress 6.3 or later and PHP 7.4 or later.

## Install

<Steps>
  <Step title="Download the plugin">
    In the dashboard, open **Integrations → Site builders**, choose
    **WordPress** and click **Download plugin**.
  </Step>

  <Step title="Upload and activate">
    In WordPress, go to **Plugins → Add New → Upload Plugin**, choose the zip,
    install it and click **Activate**.
  </Step>

  <Step title="Connect your store">
    Create an API key in Pocketsflow under **Developers → API keys**. In
    WordPress, open **Settings → Pocketsflow**, paste the key and save. Your
    store address fills in by itself.
  </Step>

  <Step title="Add a product">
    Edit a page, add the **Pocketsflow** block, pick a product and a style.
    Publish.
  </Step>
</Steps>

## Your API key

The key is used only by your WordPress server, to list your products in the
block editor and to read your store address. It is:

* stored in your site's options, never autoloaded;
* never printed on the settings page, in the block editor, in the REST API or
  on your site (the settings page only says that a key is saved);
* sent only from your server to `api.pocketsflow.com`;
* removed when you uninstall the plugin, together with every cached response.

The shortcode and the block still render without a key, as long as your store
address is set. A test key (`pk_test_…`) lists your test-mode products.

## Shortcode

```text theme={"system"}
[pocketsflow product="665f1e2a9c8d4b3a2f1e0d9c" display="button" label="Buy now" open="overlay"]
```

| Attribute | Values | Default |
| - | - | - |
| `product` | A product or subscription id (required) | |
| `type` | `product`, `subscription` | `product` |
| `display` | `button`, `link`, `card` | `button` |
| `label` | Button or link text, up to 60 characters | **Settings → Pocketsflow** |
| `open` | `overlay`, `tab` | **Settings → Pocketsflow** |

Copy a ready-made shortcode from **Integrations → Site builders → WordPress**.
It works in any editor, widget, page builder (Elementor, Divi, Beaver
Builder) or theme template (`do_shortcode`).

## Settings

**Settings → Pocketsflow** holds:

* **API key**: write-only. Paste a new key to replace it, or tick **Remove the
  saved key**.
* **Store address**: your subdomain (`yourstore`) or your custom domain
  (`shop.example.com`).
* **Button label** and **Checkout opens**: the defaults for blocks and
  shortcodes that do not set their own.

## What the plugin loads

On pages that show a Pocketsflow button, the plugin loads
`https://app.pocketsflow.com/embed.js` (deferred, in the footer) and a small
stylesheet for cards and links. Nothing loads on other pages. Without
JavaScript, every button is still a plain link to the checkout.

## Troubleshooting

| You see | Do this |
| - | - |
| "Add your store in Settings → Pocketsflow" | Save your API key, or type your store address. Only editors see this hint; visitors see nothing. |
| "Pocketsflow did not accept this API key" | The key was deleted or mistyped. Create a new one under **Developers → API keys**. |
| A product is missing from the picker | Click **Refresh list** in the block. The list is cached for five minutes. |
| A card shows as a button | Subscriptions render as a button, and a product that cannot be read publicly (unpublished, or a paused store) falls back to a button. |

## For developers

The plugin source, its tests and its WordPress.org `readme.txt` live in the
monorepo under `integrations/wordpress`. See its README for the WordPress.org
submission steps.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.