Getting started
Quickstart
From zero to your first event in under 5 minutes. Pick the platform you're shipping on.
1. Create a workspace and grab your API key
Sign up at tapemetric.com/signup. After signup, head to API keys → New key. Pick the environment (production, staging, or development) and copy the key — it’ll be shown only once.
API keys look like:
tm_live_a1b2c3d4e5f6... # production
tm_test_a1b2c3d4e5f6... # staging or development2. Install the SDK
Pick your platform:
Web (JavaScript / TypeScript)
npm install @tapemetric/analytics
# or
yarn add @tapemetric/analytics
# or
pnpm add @tapemetric/analyticsOr use the CDN build for plain HTML pages:
<style="color:#f472b6">script src="https://cdn.jsdelivr.net/npm/@tapemetric/analytics@1.0.0/dist/tapemetric.min.js"></style="color:#f472b6">script>iOS / tvOS / macOS (Swift)
Swift Package Manager — in Xcode, File → Add Packages…:
https://github.com/tapemetric/analytics-ios.gitOr CocoaPods:
pod 'TapemetricAnalytics', '~> 1.0'Android (Kotlin / Java)
// In your app's build.gradle
implementation 'com.tapemetric:analytics:1.0.0'3. Initialize
Web
import Tapemetric from '@tapemetric/analytics';
export const tm = Tapemetric.init({
apiKey: process.env.NEXT_PUBLIC_TAPEMETRIC_KEY!,
debug: process.env.NODE_ENV !== 'production',
});iOS
import TapemetricAnalytics
// In AppDelegate.application(_:didFinishLaunchingWithOptions:) or App.init()
Tapemetric.configure(
TapemetricConfig(apiKey: "tm_live_yourkey")
)Android
import com.tapemetric.analytics.Tapemetric
import com.tapemetric.analytics.TapemetricConfig
class MyApp : Application() {
override fun onCreate() {
super.onCreate()
Tapemetric.configure(this, TapemetricConfig(apiKey = "tm_live_yourkey"))
}
}4. Track your first event
Wire your player’s play event to trackPlayStart:
import { tm } from './analytics';
videoElement.addEventListener('play', () => {
tm.trackPlayStart({
contentId: 'aashiqana_s04e12',
contentType: 'series',
contentTitle: 'Aashiqana',
season: 4,
episode: 12,
});
});
videoElement.addEventListener('ended', () => {
tm.trackComplete({ positionSec: videoElement.duration });
});5. Verify it’s working
Open your Realtime dashboard at app.tapemetric.com/dashboard/realtime. You should see a concurrent viewer count tick up within 30 seconds of playback starting.
Not seeing data? Check the troubleshooting guide or look in your browser’s network tab — calls to ingest.tapemetric.com/v1/ingest/events should return 202.
What’s next
- Event schema — every field your SDK can send
- Web SDK reference — full method list and player integrations
- Analytics API — query your data programmatically