Only this pageAll pages
Powered by GitBook
1 of 13

Recoup | Webplayer

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

<OneTap />

The <OneTap /> component provides Spotify & Apple services.

Presave

The <OneTap /> component includes pre-save services for Apple Music and Spotify.

Users can pre-save the track before it will be released. Once the song / playlist / album is released, everyone who pre-saved will automatically have the track saved in their library.

Utilities

Recoup's Webplayer provides utilities to help the user experience of <OneTap />.

<SyncstreamProvider />

The SyncstreamProvider component provides streaming service of spotify.

'use client';

import { OneTap, SyncstreamProvider } from "@syncstreamai/syncstream";
import "@syncstreamai/syncstream/dist/index.css";

export default function App() {
  return (
    <SyncstreamProvider
      campaignId="EXAMPLE_CAMPAIGN_ID"
      signInRequired
    >
      <OneTap spotifyDefaultLink="spotify:artist:2hlmm7s2ICUX0LVIhVFlZQ" />
    </SyncstreamProvider>
  );
}
import React from 'react';
import { OneTap, SyncstreamProvider } from "@syncstreamai/syncstream";
import "@syncstreamai/syncstream/dist/index.css";

export default function App() {
  return (
    <SyncstreamProvider
      campaignId="EXAMPLE_CAMPAIGN_ID"
      signInRequired
    >
      <OneTap spotifyDefaultLink="spotify:artist:2hlmm7s2ICUX0LVIhVFlZQ" />
    </SyncstreamProvider>
  );
}

SyncstreamProvider component takes 2 properties:

Property
Description

campaignId

(Required) Your campaign ID assigned by .

signInRequired

Optional. use this to add a blur overlay and prevent the user from accessing the site without first connecting a streaming provider.

Resume

resume play / resume music playback from the authenticated provider.

Example

'use client';

import { OneTap, SyncstreamProvider, useSyncstream } from "@syncstreamai/syncstream";
import "@syncstreamai/syncstream/dist/index.css";

export default function App() {
  return (
    <SyncstreamProvider
      campaginId="EXAMPLE_CAMPAIGN_ID"
      signInRequired
    >
      <OneTap spotifyDefaultLink="spotify:artist:2hlmm7s2ICUX0LVIhVFlZQ" />
    </SyncstreamProvider>
  );
}

export default Example() {
  const { resume } = useSyncstream()
  
  return (
    <button
      type="button"
      onClick={resume}
    >
      Resume
    </button>
  )
}
Recoup

Apple Music

The <OneTap /> component provides Apple Music services for Premium subscribers.

You can use it as is, without any required props. 👋

Enjoy the music. 🥳

Click here to integrate Recoup's Webplayer SDK into your app. 📝

Example:

<OneTap 
  spotifyDefaultLink="spotify:artist:2hlmm7s2ICUX0LVIhVFlZQ"
  appleDefaultLink="https://music.apple.com/us/playlist/dale-play/pl.4b364b8b182f4115acbf6deb83bd5222"
/>
Property
Description

appleDefaultLink

Optional. Music to play using apple music. Also works for Presaving content.

Overview

What is the Recoup Webplayer?

It’s a free tool that lets your fans sign-in and stream music right on your website—in one click.

How does it work?

With the Recoup Webplayer, you can send fans directly TO YOUR OWN WEBSITE when promoting new music (instead of third parties). When fans land on your site they sign in with Spotify or Apple Music with one click - and start streaming directly on your site. It's so eay

Why should you care?

Capture fan emails and increase song streams (a lot).

How do I install it?

Just follow our Quickstart installation guide to embed the Webplayer on your site in minutes. No coding expertise needed! (If you need help, feel free to reach out to [email protected])


Get Started with These Popular Docs

Pause

pause music playback from the authenticated provider.

Example

'use client';

import { OneTap, SyncstreamProvider, useSyncstream } from "@syncstreamai/syncstream";
import "@syncstreamai/syncstream/dist/index.css";

export default function App() {
  return (
    <SyncstreamProvider
      campaignId="EXAMPLE_CAMPAIGN_ID"
      signInRequired
    >
      <OneTap spotifyDefaultLink="spotify:artist:2hlmm7s2ICUX0LVIhVFlZQ" />
    </SyncstreamProvider>
  );
}

export default Example() {
  const { pause } = useSyncstream()
  
  return (
    <button
      type="button"
      onClick={pause}
    >
      Pause
    </button>
  )
}

Quickstart

Start your integration in less than 5 minutes.

Spotify

Add Spotify to your website

Apple Music

Add Apple Music to your website

Spotify Presave

Spotify Presave

'use client';

import { OneTap, SyncstreamProvider } from "@syncstreamai/syncstream";
import "@syncstreamai/syncstream/dist/index.css";

export default function App() {
  return (
    <SyncstreamProvider
      campaignId="EXAMPLE_CAMPAIGN_ID"
      signInRequired
    >
      <OneTap 
        spotifyDefaultLink="spotify:album:1HOMjYmPvDpCNbb44JnFaa" 
        spotifyFreeAudioUrl={"https://boa-v2.vercel.app/audio/song.mp3"}
        spotifyPresave={{
          id: "BOA by Megan thee Stallion",
          releaseDate: "2026-07-16"
        }}
      />
    </SyncstreamProvider>
  );
}
import React from 'react';
import { OneTap, SyncstreamProvider } from "@syncstreamai/syncstream";
import "@syncstreamai/syncstream/dist/index.css";

export default function App() {
  return (
    <SyncstreamProvider
      campaignId="EXAMPLE_CAMPAIGN_ID"
      signInRequired
    >
      <OneTap 
        spotifyDefaultLink="spotify:album:1HOMjYmPvDpCNbb44JnFaa" 
        spotifyFreeAudioUrl={"https://boa-v2.vercel.app/audio/song.mp3"}
        spotifyPresave={{
          id: "BOA by Megan thee Stallion",
          releaseDate: "2026-07-16"
        }}
      />
    </SyncstreamProvider>
  );
}

<OneTap /> component takes new prop as named sportifyPresave .

Property
Description

spotifyPresave

Optional.

{ id: string, releaseDate: string }

  • Id to pre-save in spotify.

  • releaseDate to pre-save in spotify.

spotifyFreeAudioUrl

Optional. Audio for Spotify free users.

Presave UX

  1. First, click the Sign In to Presave button.

  2. Once signed in, you'll be redirected back to the artist's website.

  1. Clicking on the Big Blue Button presaves the track.

  1. Finally, enjoy music by clicking the web player here button. 🎼 🥳

Quickstart

Recoup's Webplayer is the easiest way to bring Spotify & Apple Music into your app.

Prerequisites

Before integrating the Webplayer, ensure your project meets the following requirements:

  • version 18 or higher

  • version 5 or higher

Installation

You can install the Webplayer using npm or yarn. Choose your preferred package manager and run the following command:

npm install @syncstreamai/syncstream

yarn add @syncstreamai/syncstream

Set Up Your App with Recoup's Webplayer

After installing the package, import the SyncstreamProvider component into your project and wrap your app with it. The SyncStreamProvider should wrap any component or page that will use SyncStream. It is recommended to place it as close to the root of your application as possible.

Example or :

Property Descriptions

SyncstreamProvider Component

In the examples above, notice that the SyncstreamProvider component takes one property:

Property
Description

OneTap Component In the examples above, notice that the OneTap component takes two properties:

Property
Description

The URI, or Uniform Resource Indicator, is a unique code that identifies a specific element on Spotify or Apple Music, such as an artist, album, track, playlist, or user. to convert any Spotify song or album URL into a URI. Please refer to the for more information about this.

Just use Recoup's Webplayer! 🎉

Once you've wrapped your app with the SyncstreamProvider, you can now use it throughout your components and pages via the OneTap!

campaignId

(Required) Your campaign ID assigned by Recoup.

signInRequired

(Optional) Use this to add a blur overlay and prevent the user from accessing the site without first connecting a streaming provider.

spotifyDefaultLink

Optional.

  • Spotify URI of the context to play. Valid contexts are albums, artists & playlists. "spotify:album:1Je1IMUlBXcx1Fz0WE7oPT"

  • A JSON array of the Spotify track URIs to play. For example: ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "spotify:track:1301WleyT98MSxVHPZCA6M"]

React
TypeScript
NextJS
Create React App
Click here
Spotify documentation
'use client';

import { OneTap, SyncstreamProvider } from "@syncstreamai/syncstream";
import "@syncstreamai/syncstream/dist/index.css";

export default function App() {
  return (
    <SyncstreamProvider
      campaignId="EXAMPLE_CAMPAIGN_ID"
      signInRequired
    >
      <OneTap spotifyDefaultLink="spotify:artist:2hlmm7s2ICUX0LVIhVFlZQ" />
    </SyncstreamProvider>
  );
}
import React from 'react';
import { OneTap, SyncstreamProvider } from "syncstream-ai";
import "syncstream-ai/dist/index.css";

export default function App() {
  return (
    <SyncstreamProvider
      campaignId="EXAMPLE_CAMPAIGN_ID"
      signInRequired
    >
      <OneTap spotifyDefaultLink="spotify:artist:2hlmm7s2ICUX0LVIhVFlZQ" />
    </SyncstreamProvider>
  );
}

Custom CTA

In the Custom CTA state, the CTA button displays text provided by the developer and optionally opens a custom URL specified by the developer.

'use client';

import { OneTap, SyncstreamProvider } from "syncstream-ai";
import "syncstream-ai/dist/index.css";

export default function App() {
  return (
    <SyncstreamProvider
      campaignId="EXAMPLE_CAMPAIGN_ID"
      signInRequired
    >
      <OneTap 
        spotifyDefaultLink="spotify:album:1HOMjYmPvDpCNbb44JnFaa" 
        spotifyFreeAudioUrl={"https://boa-v2.vercel.app/audio/song.mp3"}
        cta={{
	  url: "https://play.syncstream.ai",
	  text: "Sign in to Play Game"
        }}
      />
    </SyncstreamProvider>
  );
}
import React from 'react';
import { OneTap, SyncstreamProvider } from "syncstream-ai";
import "syncstream-ai/dist/index.css";

export default function App() {
  return (
    <SyncstreamProvider
      campaignId="EXAMPLE_CAMPAIGN_ID"
      signInRequired
    >
      <OneTap 
        spotifyDefaultLink="spotify:album:1HOMjYmPvDpCNbb44JnFaa" 
        spotifyFreeAudioUrl={"https://boa-v2.vercel.app/audio/song.mp3"}
        cta={{
	  url: "https://play.syncstream.ai",
	  text: "Sign in to Play Game"
        }}
      />
    </SyncstreamProvider>
  );
}

The <OneTap /> component accepts a prop named cta.

Property
Description

cta

Optional. { url: string, text: string }

text: Custom CTA button text. url: Custom CTA url (optional).

User Experience

After signing in successfully, a custom CTA button will appear. When you click this button, the cta.url will open in a new tab.

To learn more about the user experience on Spotify and Apple, click here: Spotify | Apple

Spotify

The <OneTap /> component provides Spotify services for Premium & Free subscribers.

Spotify Premium User

Spotify Premium users can enjoy the Recoup Webplayer with their Spotify account after signing in.

'use client';

import { OneTap, SyncstreamProvider } from "@syncstreamai/syncstream";
import "@syncstreamai/syncstream/dist/index.css";

export default function App() {
  return (
    <SyncstreamProvider
      clientId="EXAMPLE_CLIENT_ID"
      signInRequired
    >
      <OneTap 
        spotifyDefaultLink="spotify:album:1HOMjYmPvDpCNbb44JnFaa" 
        spotifyFreeAudioUrl={"https://boa-v2.vercel.app/audio/song.mp3"}
        spotifyStartIndex={18}
      />
    </SyncstreamProvider>
  );
}
import React from 'react';
import { OneTap, SyncstreamProvider } from "@syncstreamai/syncstream";
import "@syncstreamai/syncstream/dist/index.css";

export default function App() {
  return (
    <SyncstreamProvider
      clientId="EXAMPLE_CLIENT_ID"
      signInRequired
    >
      <OneTap 
         spotifyDefaultLink="spotify:album:1HOMjYmPvDpCNbb44JnFaa" 
         spotifyFreeAudioUrl={"https://boa-v2.vercel.app/audio/song.mp3"}
         spotifyStartIndex={18}
      />
    </SyncstreamProvider>
  );
}

Please refer to the Spotify documentation to learn more about this.

Property
Description

spotifyDefaultLink

Optional.

  • Spotify URI of the context to play. Valid contexts are albums, artists & playlists.

  • A JSON array of the Spotify track URIs to play. For example: ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "spotify:track:1301WleyT98MSxVHPZCA6M"]

spotifyFreeAudioUrl

Optional. Audio for Spotify free users.

spotifyStartIndex

Optional. Track number to begin with from the selected media in spotifyDefaultLink. Only applicable if spotifyDefaultLink is an album or a playlist.

Spotify Free User

We provide a music player for users without a Spotify subscription as well. If you have non-premium users, you can pass in a custom audio file to play.

Example:

<OneTap 
    contextUri="spotify:artist:0TnOYISbd1XYRBk9myaseg" 
    spotifyFreeAudioUrl={"https://boa-v2.vercel.app/audio/song.mp3"}
/>
Property
Description

spotifyFreeAudioUrl

Optional. music audio URL.

Apple Music Presave

Example:

<OneTap 
  spotifyDefaultLink="spotify:artist:2hlmm7s2ICUX0LVIhVFlZQ"
  appleDefaultLink="https://music.apple.com/us/playlist/dale-play/pl.4b364b8b182f4115acbf6deb83bd5222"
/>
Property
Description

appleDefaultLink

Optional. Music to play using apple music. Also works for Presaving content.

Presave UX

  1. First, click the dropdown arrow to change the sign in to Apple Music.

  2. Click the Sign In to Presave button.

  3. Once signed in, track is presaved and you'll be redirected back to the artist's website.

  1. Finally, enjoy music by clicking the web player here button. 🎼 🥳