> For the complete documentation index, see [llms.txt](https://superfluid.gitbook.io/superfluid/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://superfluid.gitbook.io/superfluid/developers/integration-guides/gating-with-superfluid-subscriptions-and-guild.xyz.md).

# Gating with Superfluid Subscriptions & Guild.xyz

This guide will thoroughly explain how to utilize Superfluid Subscriptions with Guild.xyz. Using the two, you can control access through Guild based on the existence of a Superfluid subscription stream to a desired receiving address.

#### Quick Links

[Checkout Builder](https://checkout-builder.superfluid.finance/) | [Console](https://console.superfluid.finance/matic/protocol) | [Flow Rate Converter](https://hz89i.csb.app/) | [Dashboard](https://app.superfluid.finance/) | [Guild.xyz](https://guild.xyz/)

## 1. Create Your Subscription Payment Widget

1. Head to the [Checkout Builder](https://checkout-builder.superfluid.finance/)
2. Delete the initial payment option set in **Payment Details Summary** at the bottom of the Product section.

<figure><img src="https://422548309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKEcOOf_qoYMObicyRu%2Fuploads%2FvXPKN7XnGmdlY5RJ6QZe%2FScreenshot%202023-07-26%20092734.png?alt=media&amp;token=8764d8d1-32b9-405c-ac79-a0fd0c1511ae" alt="" width="271"><figcaption></figcaption></figure>

3. Begin customizing your widget payment info on **Product** and aesthetic on **UI**
4. On **Export**, one-click deploy to IPFS and get the payment URL (or save the JSON for later if you want to embed in your site directly)

<figure><img src="https://422548309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKEcOOf_qoYMObicyRu%2Fuploads%2FBJ7mWwgOLvtlJCRNfyW2%2FUntitled.png?alt=media&amp;token=6c88e22b-e12a-4f11-97af-a03fa749a0a7" alt="" width="375"><figcaption></figcaption></figure>

## 2. Collect your Addresses

1. Copy down the CFAv1 Address for your intended network of choice from the [Console](https://console.superfluid.finance/matic/protocol)

<figure><img src="https://422548309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKEcOOf_qoYMObicyRu%2Fuploads%2F9WuJ0DRef4UAaiB794uy%2FScreenshot%202023-07-26%20093952.png?alt=media&amp;token=1529b70f-7416-44b1-8e95-2e1e3570a7cb" alt="" width="563"><figcaption></figcaption></figure>

2. Copy down the address of the Super Token you're seeking payment in from the [Console](https://console.superfluid.finance/matic/protocol). You can look through the list or search the token symbol on the search bar at the top of the page.

## 3. Get Wei/Sec Flow Rate

Head to our [Flow Rate Calculator](https://8h8ksz.csb.app/) to convert the monthly rate you elected for your Checkout Widget Payment Option into a wei/sec rate. Copy it down.

## 4. Create Your Guild Gate

1. Head to [Guild.xyz](https://guild.xyz/create-guild), select what you're looking to gate, and create a role.

<figure><img src="https://422548309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKEcOOf_qoYMObicyRu%2Fuploads%2FiSXSR86ReVNKIaDdThuI%2Fbobio.png?alt=media&amp;token=08308c12-455a-4fca-9de4-96ed6f7b65c0" alt="" width="563"><figcaption><p>Just an example of what it could look like after set up</p></figcaption></figure>

2. Select the requirement as "Contract query"

<figure><img src="https://422548309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKEcOOf_qoYMObicyRu%2Fuploads%2F1cCy8c3RJa2PPVqzW33e%2FScreenshot%202023-07-26%20114235.png?alt=media&amp;token=280ab43b-4a49-4172-bd8e-13bd047c8e02" alt="" width="354"><figcaption></figcaption></figure>

2. Select the intended network and put in the CFAv1 address copied down from earlier as the Contract Address

<figure><img src="https://422548309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKEcOOf_qoYMObicyRu%2Fuploads%2FWPAupM0Z3Ytv3WJcznIV%2Fbobio.png?alt=media&amp;token=17667419-1e01-484e-ae36-d63ce7a539d4" alt="" width="375"><figcaption></figcaption></figure>

3. In the Method dropdown, select the `getFlow` method

<figure><img src="https://422548309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKEcOOf_qoYMObicyRu%2Fuploads%2FvEMCjc4VxS7NO7tj87aT%2Fbobio.png?alt=media&amp;token=567b986a-405f-4084-8f5d-b21431317d43" alt="" width="375"><figcaption></figcaption></figure>

4. Input the following:

* `receiver` - the address to receive the subscription payments (same receiver you set in Payment Options on the Checkout Widget)
* `token` - the address of the Super Token you're accepting payment in (which you copied down earlier)
* `sender` - leave the sender address as USER\_ADDRESS

<figure><img src="https://422548309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKEcOOf_qoYMObicyRu%2Fuploads%2FHTYjLrbuGat8iSSZ0vbJ%2Fbobio.png?alt=media&amp;token=4fd1991e-5920-49fd-9c73-f6683d7a5a18" alt="" width="375"><figcaption></figcaption></figure>

5. Select flowRate in the final drop down and make the qualifier `>=`

<figure><img src="https://422548309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKEcOOf_qoYMObicyRu%2Fuploads%2FeSioTU6cAossWIIzXzsH%2Fbobio.png?alt=media&amp;token=862e2fe1-071e-46eb-8474-b7b9a12e2e24" alt="" width="375"><figcaption></figcaption></figure>

6. Input the wei/sec flow rate that you copied down earlier

<figure><img src="https://422548309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKEcOOf_qoYMObicyRu%2Fuploads%2F7RYPrDEIhdqCfULX4ypX%2Fbobio.png?alt=media&amp;token=4b37ebb5-ceda-4422-9651-852440142ab0" alt="" width="375"><figcaption></figcaption></figure>

## Start Using! :checkered\_flag:

Share your Checkout Widget with anyone - people who subscribe with it will be able to access the whatever it is you have gated with Guild.xyz.

**Additional Considerations:**

* You can layer on access levels and pricing tiers by adding payment options to your widget and configuring various roles.
