Quickstart

SyncStream is the easiest way to bring Spotify & Apple Music into your app.

Prerequisites

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

Installation

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

npm install @syncstreamai/syncstream

Set Up Your App with SyncStream

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 NextJS or Create React App:

'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>
  );
}

Property Descriptions

SyncstreamProvider Component

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

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

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. Click here to convert any Spotify song or album URL into a URI. Please refer to the Spotify documentation for more information about this.

Just use syncstream-ai! 🎉

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

Last updated