Fync

Fync Documentation

Comprehensive guide to using Fync - a powerful TypeScript API client library

What is Fync?

Fync is a TypeScript client library for integrating with multiple APIs using a consistent interface. It supports GitHub, Spotify, Google Calendar, Google Drive, Vercel, Discord, Notion, NPM, and GitLab.

Use one library instead of managing multiple API clients with different interfaces.

Features

  • Type-safe: Full TypeScript support
  • Lightweight: No dependencies
  • OAuth support: Built-in OAuth 2.0 flows
  • 9+ providers: GitHub, GitLab, Spotify, Google Calendar, Google Drive, Vercel, Discord, Notion, NPM
  • Documentation: Guides and examples for each provider
  • Consistent: Same method patterns across all APIs

Quick Start

Install Fync with your favorite package manager:

npm install @remcostoeten/fync
pnpm install @remcostoeten/fync
yarn add @remcostoeten/fync
bun add @remcostoeten/fync

Initialize your clients:

import { GitHub, Spotify, GoogleCalendar } from '@remcostoeten/fync';

const github = GitHub({ token: process.env.GITHUB_TOKEN! });
const spotify = Spotify({ token: process.env.SPOTIFY_TOKEN! });
const calendar = GoogleCalendar({ token: process.env.GOOGLE_TOKEN! });

Start making API calls:

// GitHub
const user = await github.getUser('octocat');
const repo = await github.getRepository('facebook', 'react');

// Spotify
const playlist = await spotify.getPlaylist('37i9dQZF1DXcBWIGoYBM5M');
await spotify.addTracksToPlaylist('playlistId', ['spotify:track:...']);

// Google Calendar
const events = await calendar.getUpcomingEvents('primary', 10);
await calendar.createEvent('primary', { summary: 'Meeting' });

Supported Providers

ProviderFeatures
GitHubUsers, repositories, search, organizations, issues, pull requests
GitLabProjects, issues, merge requests, pipelines, search
SpotifyTracks, playlists, player control, search, personalization
Google CalendarCalendars, events, free/busy, colors, ACL
Google DriveFiles, folders, permissions, exports, search
VercelProjects, deployments, domains, teams
Discord(Available - see provider guide)
Notion(Available - see provider guide)
NPMPackage search and information

Documentation Structure

Need Help?

Contributing

Contributions are welcome! Please visit the GitHub repository to contribute.


Happy integrating!