For the complete documentation index, see llms.txt. This page is also available as Markdown.

Log-in via Tip4Serv

Use our fresh new library tip4serv.js to allow your customers to log-in via Tip4Serv.

Working Example

For full working examples, open the live demo:

Overview

Tip4Serv.js allows you to:

  • Open checkout from a button

  • Sell subscriptions or one-time products

  • Handle quantities

  • Use a cart system

  • Trigger checkout from JavaScript

  • Allow your users to login with their Tip4Serv account

It works without backend integration.


Quickstart

Add the script to your page:

Replace YOUR_STORE_ID with your actual store ID.

You can find:

  • Store ID → in your dashboard URL or store settings

  • Product slug or ID → on each product page


Log-in via Tip4Serv

The tip4serv.js library allows your customers to log in to Tip4Serv and share permissions with your service via OAuth2. We encapsulated all the complex logic for you.

Step 1 - Start the OAuth Flow

Simply execute this JavaScript code to trigger the Tip4Serv OAuth flow.

Step 2 - Let the user grant you his permissions

The user will soon be redirected to a page where he will grant your service restricted access to his account. From the user perspective, this screen will be displayed:

Step 3 - Retrieve the user access token

Now that the user has allowed your service to access his account, save the access token. you can retrieve his token with this JavaScript code.

Use this function to move this token to the place where you are planning to make the API calls.

Step 4 - Use the user access token

Now that you have saved the user access token somewhere, you can use any routes that are present on those pages.

UserPayments (User)Subscriptions (User)

Recommendation

If you are using an AI agent (ChatGPT, Cursor, Claude, etc.), send this page for full context:

https://js.tip4serv.com/demo.html

Support

For technical questions, reach out to us on Discord or contact us via our support portal : https://tip4serv.com/contact

Last updated