> For the complete documentation index, see [llms.txt](https://docs.perkville.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.perkville.com/integrations/integrating-perkville/integrating-your-app-with-perkville/page-to-initiate-the-pkce-flow.md).

# Page to initiate the PKCE flow

If you choose to use the [PKCE OAuth flow](https://www.perkville.com/developers/docs/v2/#v2_authorization_anchor_pkce_mobile_grant) for integrating your mobile app with Perkville, it is important to create a dedicated page within your app that prompts your customers to establish the connection. This page could be shown when they click on the button for your loyalty program or for referring friends in the app.

#### Messaging

The message at the top can be fetched from the business' `app_connection_message` or you can generate your own copy if that is not present.

If the business has [not yet launched](https://docs.perkville.com/features/settings/business/business-program-status.md), you may want to suppress actionable buttons and instead display the business' `prelaunch_info_message`

<figure><img src="https://2181708597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSiE75SeColbiBVbet0NZ%2Fuploads%2F9kURZIUUrnAku1y9FFDZ%2FOovana%20Rewards%20Authorization%20Page.png?alt=media&amp;token=4055e754-4a9a-4f52-b54f-940d8357ff57" alt="" width="207"><figcaption></figcaption></figure>

#### Buttons/Actions

**Add Email**: When customers click on the "Join here" link, we recommend pre-populating their email address on the resultant page [using this method](https://docs.perkville.com/faqs/miscellaneous/is-it-possible-to-pre-populate-the-email-address-field-on-the-page-for-joining-the-reward-program). This ensures that they register on Perkville using the same email address that you have on file for them.

**Authorize Connection**: Clicking the “Authorize connection here” button will initiate the [PKCE flow](https://www.perkville.com/developers/docs/v2/#v2_authorization_anchor_pkce_mobile_grant), allowing customers to connect their accounts securely.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.perkville.com/integrations/integrating-perkville/integrating-your-app-with-perkville/page-to-initiate-the-pkce-flow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
