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/fyncpnpm install @remcostoeten/fyncyarn add @remcostoeten/fyncbun add @remcostoeten/fyncInitialize 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
| Provider | Features |
|---|---|
| GitHub | Users, repositories, search, organizations, issues, pull requests |
| GitLab | Projects, issues, merge requests, pipelines, search |
| Spotify | Tracks, playlists, player control, search, personalization |
| Google Calendar | Calendars, events, free/busy, colors, ACL |
| Google Drive | Files, folders, permissions, exports, search |
| Vercel | Projects, deployments, domains, teams |
| Discord | (Available - see provider guide) |
| Notion | (Available - see provider guide) |
| NPM | Package search and information |
Documentation Structure
- Getting Started - Installation and basic usage
- Core Concepts - Modules, resources, and API patterns
- Authentication - Bearer tokens and OAuth flows
- Provider Guides - Guides for each provider
Need Help?
- Check the Getting Started guide
- Browse provider-specific guides
- Report issues on GitHub
- Start a discussion on GitHub Discussions
Contributing
Contributions are welcome! Please visit the GitHub repository to contribute.
Happy integrating!