Create Snippets

Xano Snippets allow you to easily share API endpoints with the community.

Snippets are an easy way to share API endpoints with the Xano community. When you share a Snippet it will be available for anyone to add to their own workspace. Snippets contain all components related to the API endpoint.

You can edit or add to what is included in this Snippet. No one will have access to your workspace.

The following items can be included in your Snippet:

  • API Endpoints & Groups

  • Database Tables (you can choose to include data or not)

  • Custom Functions (that are included in your endpoints)

  • Addons (based on what endpoints you include)

  • Environment Variables (you can choose to include their content or not)

How to create a Snippet

Snippets are easy to create. Once you've create an API endpoint that you wish to publish and share, click the Snippet button on the top right-side of the endpoint page.

Once selected, there is a menu where you can add a name, description, and tags to your Snippet. You can also control access to your Snippet.

  • Public - Your snippet will be listed in the Xano Snippet directory and installable by anyone.

  • Unlisted - Your snippet will be installable by anyone with a link.

  • Private - Your snippet will only be accessible and installable by users with an access token that you provide.

Decide what gets included in your Snippet

Edit or add what's included in your Snippet by selecting show what's included in this Snippet.

Editing or adding to your Snippet is straightforward. You can:

Add additional API endpoints from the same API group This way you can share a more comprehensive solution with multiple API endpoints.

Customize the schema to include from a database table Perhaps not everything in the include table(s) is relevant for your specific Snippet.

Include records from your database table in the Snippet Often times data is crucial to having a working API endpoint. You can choose to include records from your database - whether you hand-pick one or many or include all your records. Please don't share any sensitive data in your Snippet.

NOTE: If any of the API endpoints in your Snippet include environment variables you would not want public, such as an API key, make sure to review them before proceeding.

Once you complete creation of your Snippet, you will see confirmation and a link to easily share your Snippet with the world.

Managing Private Snippet Access Tokens

When you publish a snippet that has the access type set to Private, you must generate access tokens for users who you would like to share your snippet with.

To create new access tokens, head to the Marketplace > Dev Center from the left-hand menu, and select your snippet.

Click the three dots at the top and choose Manage.

Click 'Access', and then 'Manage Tokens'

Click 'Add Token', define the number of installs, and then you can select the token that appears in the list to copy the token and share it as you'd like, and also track the number of installs.

You can also manage snippet access and generate tokens using the Metadata API.

Unpublishing and Deleting a Snippet

Navigate to your Dev Center under Marketplace in the left-hand menu. Choose the snippet you'd like to unpublish and/or delete, and then click the three dots in the upper-right corner. Choose 'Manage Snippet'. From this screen, you can unpublish and if you wish, delete your snippet.

Keep in mind that this does not impact those who have already installed your snippet; they will still have access to the imported snippet in their own workspace.

Last updated