{"id":28670901,"url":"https://github.com/revenuecat/docs","last_synced_at":"2025-06-13T18:12:40.841Z","repository":{"id":269460361,"uuid":"730388795","full_name":"RevenueCat/docs","owner":"RevenueCat","description":"RevenueCat documentation built with Docusaurus","archived":false,"fork":false,"pushed_at":"2025-06-11T17:56:37.000Z","size":182827,"stargazers_count":6,"open_issues_count":19,"forks_count":13,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-06-11T19:17:56.669Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RevenueCat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-11T20:22:08.000Z","updated_at":"2025-06-11T10:22:47.000Z","dependencies_parsed_at":"2025-06-11T18:51:26.067Z","dependency_job_id":null,"html_url":"https://github.com/RevenueCat/docs","commit_stats":null,"previous_names":["revenuecat/docs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RevenueCat/docs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevenueCat%2Fdocs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevenueCat%2Fdocs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevenueCat%2Fdocs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevenueCat%2Fdocs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RevenueCat","download_url":"https://codeload.github.com/RevenueCat/docs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevenueCat%2Fdocs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259695324,"owners_count":22897516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-13T18:12:39.989Z","updated_at":"2025-06-13T18:12:40.816Z","avatar_url":"https://github.com/RevenueCat.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RevenueCat Documentation\n\nThis documentation website is built using [Docusaurus](https://docusaurus.io/).\n\n## 🚀 Quick Start\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/RevenueCat/docs.git\n   cd docusaurus\n   ```\n\n2. **Install dependencies**\n\n   ```bash\n   yarn install\n   ```\n\n3. **Start development server**\n   ```bash\n   yarn start\n   ```\n   This opens `http://localhost:3030` and auto-reloads when you make changes.\n\n## 📝 Contributing\n\n**If you aren't comfortable using GitHub to make changes, please contact [RevenueCat Support](https://app.revenuecat.com/settings/support) or open an Issue with your requested change [here](https://github.com/RevenueCat/docusaurus/issues/new).**\n\n### Making Changes\n\n1. **Create a new branch** for your changes\n2. **Edit documentation** in the `/docs` folder using Markdown (`.md`) or MDX (`.mdx`)\n3. **Test locally** using `yarn start`\n4. **Open a Pull Request** - this automatically deploys to the dev environment\n5. **Review and merge** - changes are automatically deployed to production\n\n### File Structure\n\n```\ndocusaurus/\n├── docs/                    # Documentation content (.md/.mdx files)\n├── src/\n│   ├── components/          # React components\n│   ├── css/                # Global styles\n│   ├── sidebars/           # Sidebar configuration utilities\n│   └── theme/              # Theme customizations\n├── static/\n│   ├── icons/              # SVG icons for sidebar categories\n│   ├── img/                # Images and assets\n│   └── fonts/              # Custom fonts\n├── sidebars.ts             # Sidebar navigation structure\n└── docusaurus.config.js    # Site configuration\n```\n\n# 📘 Content Guidelines\n\n## Writing Documentation\n\n### Markdown Files\n\n- Use `.md` for simple documentation without React components\n- Use `.mdx` for pages that need custom components or code snippets\n- Store files in appropriate subdirectories within `/docs`\n- Use descriptive filenames that match the content\n\n### Style Guidelines\n\n- **Headers**: Use clear, descriptive headings with proper hierarchy (beginning with H2 → H3, etc.)\n- **Code**: Use proper syntax highlighting with language tags\n- **Images**: Optimize images and use descriptive alt text\n- **Links**: Use relative links for internal pages, absolute for external\n\n### Content Organization\n\n- **Logical Flow**: Organize content from basic to advanced concepts\n- **Cross-References**: Link to related sections and external resources\n- **Examples**: Include practical examples and use cases\n- **Screenshots**: Keep images up-to-date and annotated when helpful\n\n## Adding Rich Content\n\n### Code Snippets\n\nFor tabbed code blocks, use the global `RCCodeBlock` component in `.mdx` files:\n\n```jsx\nimport content from \"@site/code_blocks/welcome/getting_started.swift?raw\";\n\n\u003cRCCodeBlock\n  tabs={[\n    {\n      type: RCCodeBlock.languages.swift,\n      content: content,\n      title: \"iOS Implementation\", // optional\n    },\n    {\n      type: RCCodeBlock.languages.kotlin,\n      content: kotlinContent,\n      title: \"Android Implementation\", // optional\n    },\n  ]}\n/\u003e;\n```\n\n**Please note:** `.ts` and `.js` files are unsupported. Please add the plain text `.txt` suffix to these snippets, and reference like:\n\n```jsx\nimport content from \"@site/code_blocks/welcome/getting_started.ts.txt?raw\";\n```\n\n**Supported Languages**: Check `RCCodeBlock.languages` for available syntax highlighting.\n\n### YouTube Embeds\n\nAdd video content using the global `YouTubeEmbed` component:\n\n```jsx\n\u003cYouTubeEmbed videoId=\"dQw4w9WgXcQ\" title=\"Getting Started with RevenueCat\" /\u003e\n```\n\n### Images and Media\n\n- Store images in `/static/img/` directory\n- Use WebP format when possible for better performance\n- Include descriptive alt text for accessibility\n- Consider dark mode compatibility\n\n## Sidebars\n\nThe sidebar system is the heart of the documentation navigation, defined in `sidebars.ts`. The system uses TypeScript utilities from `sidebar-utils.ts` to create a structured tree of categories, subcategories, pages, and links.\n\n[Video Explanation](https://www.loom.com/share/68d0f56195034c8d9badf454beb7d899?sid=b312b6f7-8f9e-43c5-9f98-6db5f7548944)\n\n### Sidebar Structure\n\nThere are **four types of sidebar items**:\n\n1. **Category** - Top-level sections with icons and custom styling\n2. **SubCategory** - Collapsible sections that can have their own landing pages\n3. **Page** - Individual documentation pages\n4. **Link** - References to pages in other categories\n\n### Category Configuration\n\nCategories are the main navigation sections and support custom icons and colors:\n\n```js\nconst exampleCategory = Category({\n  iconName: \"sparkle\", // Icon from /static/icons/ directory\n  iconColor: \"var(--rc-blue-primary)\", // Optional custom color (defaults to blue)\n  label: \"Example Category\",\n  itemsPathPrefix: \"example/\", // Path prefix for all items in this category\n  items: [\n    // ... category items\n  ],\n});\n```\n\n**Available Icons**: The `iconName` should correspond to SVG files in `/static/icons/`. Common icons include:\n\n- `\"sparkle\"` - For guides and highlights\n- `\"hammer\"` - For projects and development\n- `\"mobile\"` - For SDK documentation\n- `\"person\"` - For customer-related docs\n- `\"chart-bar\"` - For analytics and metrics\n- `\"key\"` - For account and security\n\n**Icon Colors**: Use CSS variables for consistent theming:\n\n- `\"var(--rc-red-primary)\"` - Default red theme\n- `\"var(--rc-blue-primary)\"` - Blue accent\n- `\"var(--rc-green-primary)\"` - Success/positive actions\n- Custom colors can be defined in `custom.css`\n\n### SubCategory Configuration\n\nSubCategories create collapsible sections within categories:\n\n```js\nSubCategory({\n  label: \"Getting Started\",\n  slug: \"getting-started\", // Optional: creates a landing page\n  itemsPathPrefix: \"getting-started/\",\n  items: [Page({ slug: \"quickstart\" }), Page({ slug: \"installation\" })],\n  index: {\n    // Optional: generated index page\n    title: \"Getting Started Guide\",\n    link: \"getting-started-overview\",\n    description: \"Learn the basics of RevenueCat\",\n  },\n});\n```\n\n### Page Configuration\n\nPages represent individual documentation files:\n\n```js\nPage({ slug: \"installation/ios\" });\n// References: /docs/installation/ios.md or ios.mdx\n```\n\nThe final path is constructed as: `itemsPathPrefix + slug`\n\n### Link Configuration\n\nLinks reference pages in other categories:\n\n```js\nLink({\n  label: \"SDK Reference\",\n  slug: \"/platform-resources/sdk-reference\",\n});\n// Creates a link with arrow indicator (→)\n```\n\n### Complete Example\n\n```js\nconst mobileSDKCategory = Category({\n  iconName: \"mobile\",\n  label: \"RevenueCat SDK\",\n  itemsPathPrefix: \"getting-started/\",\n  items: [\n    Page({ slug: \"quickstart\" }),\n    SubCategory({\n      label: \"Install the SDK\",\n      slug: \"installation\",\n      itemsPathPrefix: \"installation/\",\n      items: [\n        Page({ slug: \"ios\" }), // → /docs/getting-started/installation/ios\n        Page({ slug: \"android\" }), // → /docs/getting-started/installation/android\n        Page({ slug: \"reactnative\" }),\n      ],\n    }),\n    Link({\n      label: \"Identifying Users\",\n      slug: \"/customers/user-ids\",\n    }),\n  ],\n});\n```\n\n### Multiple Sidebars\n\nThe system supports multiple sidebar configurations:\n\n```js\nconst sidebars = {\n  defaultSidebar: [\n    welcomeCategory,\n    projectsCategory,\n    mobileSDKCategory,\n    // ... more categories\n  ],\n  dataSidebar: [metricsCategory, chartsCategory],\n  integrationsSidebar: [eventsCategory, webhooksCategory],\n};\n```\n\n### Path Resolution\n\nPaths are built hierarchically:\n\n- **Base**: `/docs/`\n- **Category prefix**: `itemsPathPrefix` from Category\n- **SubCategory prefix**: `itemsPathPrefix` from SubCategory\n- **Page slug**: `slug` from Page\n\nExample: `Category({ itemsPathPrefix: \"sdk/\" })` → `SubCategory({ itemsPathPrefix: \"ios/\" })` → `Page({ slug: \"installation\" })` = `/docs/sdk/ios/installation`\n\n### Best Practices\n\n1. **Consistent Iconography**: Use appropriate icons that match the content type\n2. **Logical Grouping**: Group related content in SubCategories\n3. **Clear Labels**: Use descriptive labels that match the content\n4. **Path Prefixes**: Use consistent path prefixes to organize file structure\n5. **Color Coding**: Use custom colors sparingly for important categories\n\n# 🛠️ Development\n\n## Prerequisites\n\n- **Node.js**: Version 18+ recommended\n- **Yarn**: Package manager (or npm)\n\n## Installation\n\n```bash\n# Install dependencies\nyarn install\n\n# Optional: Install typos checker for spell checking\nbrew install typos-cli\n```\n\nThe typos checker helps catch spelling errors and can be integrated with:\n\n- Pre-commit hooks (automatic when `typos-cli` is installed)\n- [VS Code extension](https://marketplace.visualstudio.com/items?itemName=tekumara.typos-vscode)\n- GitHub Actions (runs on PRs)\n\n## Development Commands\n\n```bash\n# Start development server (with hot reload)\nyarn start\n\n# Build for production\nyarn build\n\n# Serve production build locally\nyarn serve\n```\n\n## Local Development\n\n```bash\nyarn start\n```\n\nThis command:\n\n- Starts a local development server on `http://localhost:3000`\n- Opens your browser automatically\n- Enables hot reloading for most changes\n- Shows build errors and warnings in the console\n\n### Development Tips\n\n- **Fast Refresh**: Most changes reflect immediately without full page reload\n- **Search**: Local search is available and indexes content automatically\n- **Dark Mode**: Test both light and dark themes\n- **Mobile**: Test responsive design on different screen sizes\n\n## Building and Deployment\n\n### Production Build\n\n```bash\nyarn build\n```\n\nThis generates static content in the `build` directory that can be served by any static hosting service.\n\n### Preview Production Build\n\n```bash\nyarn build \u0026\u0026 yarn serve\n```\n\nThis serves the production build locally on `http://localhost:3000` to test before deployment.\n\n### Deployment Environments\n\n- **Development**: Automatic deployment on PR creation\n- **Production**: Automatic deployment on merge to main branch\n- **Manual**: Can be deployed to any static hosting service\n\n## 🔧 Troubleshooting\n\n### Common Issues\n\n**Build Failures**\n\n- Check for invalid Markdown syntax in `/docs` files\n- Ensure all imported components are properly installed\n- Verify all links and images exist\n\n**Missing Content**\n\n- Check `sidebars.ts` configuration\n- Verify file paths match the sidebar structure\n- Ensure files have proper frontmatter\n\n**Styling Issues**\n\n- Check CSS custom properties in `src/css/custom.css`\n- Verify Tailwind classes are properly configured\n- Test in both light and dark modes\n\n### Getting Help\n\n1. **Check the console** for build errors and warnings\n2. **Review the Docusaurus docs** at [docusaurus.io](https://docusaurus.io/)\n3. **Search existing issues** in the repository\n4. **Open a new issue** with detailed information about the problem\n\n## 🎨 Customization\n\n### Theming\n\n- **Colors**: Modify CSS variables in `src/css/custom.css`\n- **Fonts**: Add custom fonts to `/static/fonts/` and update CSS\n- **Components**: Override theme components in `src/theme/`\n\n### Configuration\n\n- **Site settings**: Edit `docusaurus.config.js`\n- **Navigation**: Update `sidebars.ts`\n- **Plugins**: Add/configure plugins in the config file\n\n## 🤝 Contributing Guidelines\n\n### Before You Start\n\n1. **Check existing issues** to avoid duplicate work\n2. **Discuss major changes** in an issue before implementation\n3. **Follow the style guide** for consistency\n\n### Pull Request Process\n\n1. **Create a descriptive PR title** and description\n2. **Link related issues** using keywords (fixes #123)\n3. **Request review** from appropriate team members\n\n---\n\n## 🔗 Links\n\n- **Live Documentation**: [docs.revenuecat.com](https://docs.revenuecat.com)\n- **RevenueCat Dashboard**: [app.revenuecat.com](https://app.revenuecat.com)\n- **Support**: [RevenueCat Support](https://app.revenuecat.com/settings/support)\n- **Community**: [RevenueCat Community](https://community.revenuecat.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevenuecat%2Fdocs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frevenuecat%2Fdocs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevenuecat%2Fdocs/lists"}