├── .eslintrc.json ├── postcss.config.mjs ├── src ├── app │ ├── global.css │ ├── api │ │ └── search │ │ │ └── route.ts │ ├── layout.config.tsx │ ├── layout.tsx │ └── [[...slug]] │ │ └── page.tsx ├── lib │ └── source.ts └── mdx-components.tsx ├── next.config.mjs ├── content └── docs │ ├── test.mdx │ ├── meta.json │ ├── ai-docs.mdx │ ├── data-generation.mdx │ ├── data-connectors.mdx │ ├── contribute-earn.mdx │ ├── api-key-generation.mdx │ ├── index.mdx │ ├── sdk-usage.mdx │ ├── installation.mdx │ ├── quick-start.mdx │ ├── concepts.mdx │ ├── platform-overview.mdx │ ├── best-practices.mdx │ ├── features.mdx │ └── features │ ├── api.mdx │ └── sdk.mdx ├── .gitignore ├── source.config.ts ├── package.json ├── tsconfig.json ├── public ├── logo.svg └── favicon.svg └── README.md /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["next/core-web-vitals", "next/typescript"] 3 | } 4 | -------------------------------------------------------------------------------- /postcss.config.mjs: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | '@tailwindcss/postcss': {}, 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /src/app/global.css: -------------------------------------------------------------------------------- 1 | @import 'tailwindcss'; 2 | @import 'fumadocs-ui/css/neutral.css'; 3 | @import 'fumadocs-ui/css/preset.css'; 4 | -------------------------------------------------------------------------------- /next.config.mjs: -------------------------------------------------------------------------------- 1 | import { createMDX } from 'fumadocs-mdx/next'; 2 | 3 | const withMDX = createMDX(); 4 | 5 | /** @type {import('next').NextConfig} */ 6 | const config = { 7 | reactStrictMode: true, 8 | }; 9 | 10 | export default withMDX(config); 11 | -------------------------------------------------------------------------------- /src/app/api/search/route.ts: -------------------------------------------------------------------------------- 1 | import { source } from '@/lib/source'; 2 | import { createFromSource } from 'fumadocs-core/search/server'; 3 | 4 | export const { GET } = createFromSource(source, { 5 | // https://docs.orama.com/open-source/supported-languages 6 | language: 'english', 7 | }); 8 | -------------------------------------------------------------------------------- /src/lib/source.ts: -------------------------------------------------------------------------------- 1 | import { docs } from "@/.source"; 2 | import { loader } from "fumadocs-core/source"; 3 | 4 | // See https://fumadocs.vercel.app/docs/headless/source-api for more info 5 | export const source = loader({ 6 | // it assigns a URL to your pages 7 | baseUrl: "/", 8 | source: docs.toFumadocsSource(), 9 | }); 10 | -------------------------------------------------------------------------------- /content/docs/test.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Components 3 | description: Components 4 | --- 5 | 6 | ## Code Block 7 | 8 | ```js 9 | console.log('Hello World'); 10 | ``` 11 | 12 | ## Cards 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/mdx-components.tsx: -------------------------------------------------------------------------------- 1 | import defaultMdxComponents from 'fumadocs-ui/mdx'; 2 | import type { MDXComponents } from 'mdx/types'; 3 | 4 | // use this function to get MDX components, you will need it for rendering MDX 5 | export function getMDXComponents(components?: MDXComponents): MDXComponents { 6 | return { 7 | ...defaultMdxComponents, 8 | ...components, 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # deps 2 | /node_modules 3 | 4 | # generated content 5 | .contentlayer 6 | .content-collections 7 | .source 8 | 9 | # test & build 10 | /coverage 11 | /.next/ 12 | /out/ 13 | /build 14 | *.tsbuildinfo 15 | 16 | # misc 17 | .DS_Store 18 | *.pem 19 | /.pnp 20 | .pnp.js 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | # others 26 | .env*.local 27 | .vercel 28 | next-env.d.ts -------------------------------------------------------------------------------- /content/docs/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "index", 4 | "quick-start", 5 | "concepts", 6 | "platform-overview", 7 | "---", 8 | "ai-docs", 9 | "data-connectors", 10 | "data-generation", 11 | "contribute-earn", 12 | "---", 13 | "api-key-generation", 14 | "sdk-usage", 15 | "installation", 16 | "features", 17 | "./features/sdk", 18 | "./features/api" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /source.config.ts: -------------------------------------------------------------------------------- 1 | import { 2 | defineConfig, 3 | defineDocs, 4 | frontmatterSchema, 5 | metaSchema, 6 | } from 'fumadocs-mdx/config'; 7 | 8 | // You can customise Zod schemas for frontmatter and `meta.json` here 9 | // see https://fumadocs.vercel.app/docs/mdx/collections#define-docs 10 | export const docs = defineDocs({ 11 | docs: { 12 | schema: frontmatterSchema, 13 | }, 14 | meta: { 15 | schema: metaSchema, 16 | }, 17 | }); 18 | 19 | export default defineConfig({ 20 | mdxOptions: { 21 | // MDX options 22 | }, 23 | }); 24 | -------------------------------------------------------------------------------- /content/docs/ai-docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: AI Documentation 3 | description: Comprehensive documentation for AI-related features and capabilities 4 | group: FEATURES 5 | --- 6 | 7 | # AI Documentation 8 | 9 | This section contains comprehensive documentation for AI-related features and capabilities. 10 | 11 | ## Overview 12 | 13 | Learn how to integrate and use AI features in your applications. 14 | 15 | ## Topics 16 | 17 | - AI Model Integration 18 | - Natural Language Processing 19 | - Machine Learning Features 20 | - AI-powered Analytics 21 | 22 | ## Getting Started 23 | 24 | Follow our guides to quickly integrate AI capabilities into your projects. 25 | -------------------------------------------------------------------------------- /src/app/layout.config.tsx: -------------------------------------------------------------------------------- 1 | import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared"; 2 | 3 | /** 4 | * Shared layout configurations 5 | * 6 | * you can customise layouts individually from: 7 | * Home Layout: app/(home)/layout.tsx 8 | * Docs Layout: app/docs/layout.tsx 9 | */ 10 | export const baseOptions: BaseLayoutProps = { 11 | nav: { 12 | title: ( 13 | <> 14 | Syncora Logo 21 | Syncora 22 | 23 | ), 24 | }, 25 | // see https://fumadocs.dev/docs/ui/navigation/links 26 | links: [], 27 | }; 28 | -------------------------------------------------------------------------------- /content/docs/data-generation.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Data Generation 3 | description: Generate synthetic data for testing, development, and analytics purposes 4 | group: FEATURES 5 | --- 6 | 7 | # Data Generation 8 | 9 | Generate synthetic data for testing, development, and analytics purposes. 10 | 11 | ## Features 12 | 13 | ### Synthetic Data Creation 14 | 15 | - Generate realistic test data 16 | - Custom data schemas 17 | - Bulk data generation 18 | 19 | ### Data Templates 20 | 21 | - User profiles 22 | - Product catalogs 23 | - Transaction records 24 | - Sensor data 25 | 26 | ## Use Cases 27 | 28 | - Development and testing 29 | - Machine learning training 30 | - Performance testing 31 | - Demo applications 32 | 33 | ## Configuration 34 | 35 | Learn how to configure data generation parameters and schemas. 36 | -------------------------------------------------------------------------------- /content/docs/data-connectors.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Data Connectors 3 | description: Connect to various data sources and integrate them seamlessly into your applications 4 | group: FEATURES 5 | --- 6 | 7 | # Data Connectors 8 | 9 | Connect to various data sources and integrate them seamlessly into your applications. 10 | 11 | ## Supported Connectors 12 | 13 | ### Database Connectors 14 | 15 | - PostgreSQL 16 | - MySQL 17 | - MongoDB 18 | - Redis 19 | 20 | ### API Connectors 21 | 22 | - REST APIs 23 | - GraphQL 24 | - WebSocket connections 25 | 26 | ### Cloud Services 27 | 28 | - AWS S3 29 | - Google Cloud Storage 30 | - Azure Blob Storage 31 | 32 | ## Configuration 33 | 34 | Learn how to configure and manage your data connectors for optimal performance. 35 | 36 | ## Best Practices 37 | 38 | Follow our recommended practices for secure and efficient data connections. 39 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "syncora-docs", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "build": "next build", 7 | "dev": "next dev --turbo", 8 | "start": "next start", 9 | "postinstall": "bunx fumadocs-mdx" 10 | }, 11 | "dependencies": { 12 | "next": "15.4.4", 13 | "react": "^19.1.0", 14 | "react-dom": "^19.1.0", 15 | "fumadocs-ui": "15.6.6", 16 | "fumadocs-core": "15.6.6", 17 | "fumadocs-mdx": "11.7.1" 18 | }, 19 | "devDependencies": { 20 | "@types/node": "24.1.0", 21 | "@types/react": "^19.1.8", 22 | "@types/react-dom": "^19.1.6", 23 | "typescript": "^5.8.3", 24 | "@types/mdx": "^2.0.13", 25 | "@tailwindcss/postcss": "^4.1.11", 26 | "tailwindcss": "^4.1.11", 27 | "postcss": "^8.5.6", 28 | "eslint": "^8", 29 | "eslint-config-next": "15.4.4" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import "@/app/global.css"; 2 | import { DocsLayout } from "fumadocs-ui/layouts/docs"; 3 | import { RootProvider } from "fumadocs-ui/provider"; 4 | import type { ReactNode } from "react"; 5 | import { baseOptions } from "@/app/layout.config"; 6 | import { source } from "@/lib/source"; 7 | 8 | export default function Layout({ children }: { children: ReactNode }) { 9 | return ( 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | {children} 19 | 20 | 21 | 22 | 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "target": "ESNext", 5 | "lib": [ 6 | "dom", 7 | "dom.iterable", 8 | "esnext" 9 | ], 10 | "allowJs": true, 11 | "skipLibCheck": true, 12 | "strict": true, 13 | "forceConsistentCasingInFileNames": true, 14 | "noEmit": true, 15 | "esModuleInterop": true, 16 | "module": "esnext", 17 | "moduleResolution": "bundler", 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "jsx": "preserve", 21 | "incremental": true, 22 | "paths": { 23 | "@/.source": [ 24 | "./.source/index.ts" 25 | ], 26 | "@/*": [ 27 | "./src/*" 28 | ] 29 | }, 30 | "plugins": [ 31 | { 32 | "name": "next" 33 | } 34 | ] 35 | }, 36 | "include": [ 37 | "next-env.d.ts", 38 | "**/*.ts", 39 | "**/*.tsx", 40 | ".next/types/**/*.ts" 41 | ], 42 | "exclude": [ 43 | "node_modules" 44 | ] 45 | } -------------------------------------------------------------------------------- /content/docs/contribute-earn.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Contribute and Earn 3 | description: Join our community and earn rewards by contributing to the platform 4 | group: COMMUNITY 5 | --- 6 | 7 | # Contribute and Earn 8 | 9 | Join our community and earn rewards by contributing to the platform. 10 | 11 | ## How to Contribute 12 | 13 | ### Code Contributions 14 | 15 | - Submit pull requests 16 | - Report bugs 17 | - Suggest new features 18 | - Improve documentation 19 | 20 | ### Content Contributions 21 | 22 | - Write tutorials 23 | - Create examples 24 | - Share use cases 25 | - Community support 26 | 27 | ## Rewards Program 28 | 29 | ### Earning Points 30 | 31 | - Code contributions: 100-500 points 32 | - Documentation: 50-200 points 33 | - Bug reports: 25-100 points 34 | - Community help: 10-50 points 35 | 36 | ### Redemption 37 | 38 | - Platform credits 39 | - Premium features 40 | - Exclusive access 41 | - Recognition badges 42 | 43 | ## Getting Started 44 | 45 | Learn how to start contributing and earning rewards today. 46 | -------------------------------------------------------------------------------- /content/docs/api-key-generation.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: API Key Generation 3 | description: Generate and manage API keys for secure access to our platform 4 | group: SETUP 5 | --- 6 | 7 | # API Key Generation 8 | 9 | Generate and manage API keys for secure access to our platform. 10 | 11 | ## Creating API Keys 12 | 13 | ### Step 1: Access the Dashboard 14 | 15 | Navigate to your account dashboard and locate the API section. 16 | 17 | ### Step 2: Generate New Key 18 | 19 | Click "Generate New API Key" and configure the following: 20 | 21 | - Key name/description 22 | - Permissions scope 23 | - Expiration date 24 | - Rate limits 25 | 26 | ### Step 3: Secure Storage 27 | 28 | Store your API key securely and never share it publicly. 29 | 30 | ## Key Management 31 | 32 | ### Viewing Keys 33 | 34 | - List all active keys 35 | - Check usage statistics 36 | - Monitor rate limits 37 | 38 | ### Security Best Practices 39 | 40 | - Rotate keys regularly 41 | - Use environment variables 42 | - Implement proper access controls 43 | - Monitor for suspicious activity 44 | 45 | ## Usage Examples 46 | 47 | ```javascript 48 | // Using API key in requests 49 | const response = await fetch("/api/data", { 50 | headers: { 51 | Authorization: "Bearer YOUR_API_KEY", 52 | "Content-Type": "application/json", 53 | }, 54 | }); 55 | ``` 56 | -------------------------------------------------------------------------------- /content/docs/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Welcome 3 | description: Get started with Syncora - AI-powered synthetic data generation platform 4 | group: INTRODUCTION 5 | --- 6 | 7 | # Welcome to Syncora 8 | 9 | Syncora is an AI-powered platform that enables you to generate high-quality synthetic data for your applications. Whether you're building machine learning models, testing applications, or need data for development, Syncora provides the tools you need. 10 | 11 | ## Quick Navigation 12 | 13 | - **[Quick start](/quick-start)** - Get up and running in minutes 14 | - **[Concepts](/concepts)** - Understanding AI and synthetic data 15 | - **[Best practices](/best-practices)** - Guidelines for optimal results 16 | - **[Platform overview](/platform-overview)** - Explore all features 17 | - **[Features](/features)** - SDK, API, and integration guides 18 | 19 | ## What You Can Do 20 | 21 | - **Generate Synthetic Data** - Create realistic datasets for any use case 22 | - **Connect Data Sources** - Integrate with your existing data infrastructure 23 | - **Contribute & Earn** - Share your expertise and earn rewards 24 | - **Build with SDK** - Integrate Syncora into your applications 25 | 26 | Get started by exploring our [Quick start guide](/quick-start) or dive into our [platform overview](/platform-overview) to see all available features. 27 | -------------------------------------------------------------------------------- /public/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /public/favicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/app/[[...slug]]/page.tsx: -------------------------------------------------------------------------------- 1 | import { source } from "@/lib/source"; 2 | import { 3 | DocsPage, 4 | DocsBody, 5 | DocsDescription, 6 | DocsTitle, 7 | } from "fumadocs-ui/page"; 8 | import { notFound } from "next/navigation"; 9 | import { createRelativeLink } from "fumadocs-ui/mdx"; 10 | import { getMDXComponents } from "@/mdx-components"; 11 | 12 | export default async function Page(props: { 13 | params: Promise<{ slug?: string[] }>; 14 | }) { 15 | const params = await props.params; 16 | const page = source.getPage(params.slug); 17 | if (!page) notFound(); 18 | 19 | const MDXContent = page.data.body; 20 | 21 | return ( 22 | 23 | {page.data.title} 24 | {page.data.description} 25 | 26 | 32 | 33 | 34 | ); 35 | } 36 | 37 | export async function generateStaticParams() { 38 | return source.generateParams(); 39 | } 40 | 41 | export async function generateMetadata(props: { 42 | params: Promise<{ slug?: string[] }>; 43 | }) { 44 | const params = await props.params; 45 | const page = source.getPage(params.slug); 46 | if (!page) notFound(); 47 | 48 | return { 49 | title: page.data.title, 50 | description: page.data.description, 51 | }; 52 | } 53 | -------------------------------------------------------------------------------- /content/docs/sdk-usage.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: SDK Usage 3 | description: Integrate our platform into your applications using our official SDKs 4 | group: FEATURES 5 | --- 6 | 7 | # SDK Usage 8 | 9 | Integrate our platform into your applications using our official SDKs. 10 | 11 | ## Available SDKs 12 | 13 | ### JavaScript/TypeScript 14 | 15 | ```bash 16 | npm install @syncora/sdk 17 | ``` 18 | 19 | ### Python 20 | 21 | ```bash 22 | pip install syncora-sdk 23 | ``` 24 | 25 | ### Go 26 | 27 | ```bash 28 | go get github.com/syncora/sdk 29 | ``` 30 | 31 | ## Quick Start 32 | 33 | ### JavaScript Example 34 | 35 | ```javascript 36 | import { SyncoraClient } from "@syncora/sdk"; 37 | 38 | const client = new SyncoraClient({ 39 | apiKey: "your-api-key", 40 | environment: "production", 41 | }); 42 | 43 | // Fetch data 44 | const data = await client.getData({ 45 | source: "users", 46 | limit: 100, 47 | }); 48 | ``` 49 | 50 | ### Python Example 51 | 52 | ```python 53 | from syncora import SyncoraClient 54 | 55 | client = SyncoraClient( 56 | api_key="your-api-key", 57 | environment="production" 58 | ) 59 | 60 | # Fetch data 61 | data = client.get_data( 62 | source="users", 63 | limit=100 64 | ) 65 | ``` 66 | 67 | ## Advanced Usage 68 | 69 | ### Error Handling 70 | 71 | ```javascript 72 | try { 73 | const result = await client.processData(data); 74 | } catch (error) { 75 | console.error("API Error:", error.message); 76 | } 77 | ``` 78 | 79 | ### Configuration Options 80 | 81 | - Environment settings 82 | - Retry policies 83 | - Timeout configurations 84 | - Logging options 85 | -------------------------------------------------------------------------------- /content/docs/installation.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Installation 3 | description: Get started with our platform by following these installation guides 4 | group: SETUP 5 | --- 6 | 7 | # Installation 8 | 9 | Get started with our platform by following these installation guides. 10 | 11 | ## Prerequisites 12 | 13 | Before installing, ensure you have: 14 | 15 | - Node.js 18+ (for JavaScript SDK) 16 | - Python 3.8+ (for Python SDK) 17 | - Go 1.19+ (for Go SDK) 18 | 19 | ## Installation Methods 20 | 21 | ### NPM (Recommended for JavaScript/TypeScript) 22 | 23 | ```bash 24 | npm install @syncora/sdk 25 | ``` 26 | 27 | ### Yarn 28 | 29 | ```bash 30 | yarn add @syncora/sdk 31 | ``` 32 | 33 | ### Python (pip) 34 | 35 | ```bash 36 | pip install syncora-sdk 37 | ``` 38 | 39 | ### Go (go get) 40 | 41 | ```bash 42 | go get github.com/syncora/sdk 43 | ``` 44 | 45 | ## Environment Setup 46 | 47 | ### 1. Get Your API Key 48 | 49 | - Sign up at [syncora.com](https://syncora.com) 50 | - Navigate to your dashboard 51 | - Generate a new API key 52 | 53 | ### 2. Configure Environment Variables 54 | 55 | ```bash 56 | # .env file 57 | SYNCORA_API_KEY=your-api-key-here 58 | SYNCORA_ENVIRONMENT=production 59 | ``` 60 | 61 | ### 3. Verify Installation 62 | 63 | ```javascript 64 | // Test your installation 65 | import { SyncoraClient } from "@syncora/sdk"; 66 | 67 | const client = new SyncoraClient({ 68 | apiKey: process.env.SYNCORA_API_KEY, 69 | }); 70 | 71 | console.log("SDK installed successfully!"); 72 | ``` 73 | 74 | ## Troubleshooting 75 | 76 | ### Common Issues 77 | 78 | - **API Key not found**: Ensure your API key is correctly set 79 | - **Network errors**: Check your internet connection 80 | - **Version conflicts**: Update to the latest SDK version 81 | 82 | ### Support 83 | 84 | If you encounter issues, check our [troubleshooting guide](link-to-troubleshooting) or contact support. 85 | -------------------------------------------------------------------------------- /content/docs/quick-start.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Quick start 3 | description: Get started with Syncora in minutes 4 | group: INTRODUCTION 5 | --- 6 | 7 | # Quick start 8 | 9 | Welcome to Syncora! This guide will help you get up and running in just a few minutes. 10 | 11 | ## 1. Access the Platform 12 | 13 | Visit [Syncora Platform](https://app.syncora.ai) to access our web application. 14 | 15 | ## 2. Create Your Account 16 | 17 | ### Sign Up 18 | 19 | 1. Click the **"Sign Up"** button on the homepage 20 | 2. Enter your email address 21 | 3. Create a strong password 22 | 4. Verify your email address 23 | 5. Complete your profile setup 24 | 25 | ### Login 26 | 27 | 1. Navigate to the login page 28 | 2. Enter your email and password 29 | 3. Click **"Sign In"** 30 | 31 | ## 3. Generate Your First API Key 32 | 33 | 1. After logging in, go to **Settings** → **API Keys** 34 | 2. Click **"Generate New API Key"** 35 | 3. Give your key a descriptive name 36 | 4. Copy the generated key and store it securely 37 | 38 | ## 4. Install the SDK 39 | 40 | ```bash 41 | npm install @syncora/sdk 42 | ``` 43 | 44 | ## 5. Create Your First Synthetic Dataset 45 | 46 | ```javascript 47 | import { SyncoraClient } from "@syncora/sdk"; 48 | 49 | const client = new SyncoraClient({ 50 | apiKey: "your-api-key-here", 51 | }); 52 | 53 | const dataset = await client.generateData({ 54 | schema: { 55 | users: { 56 | fields: { 57 | name: "string", 58 | email: "email", 59 | age: "number", 60 | }, 61 | count: 1000, 62 | }, 63 | }, 64 | }); 65 | 66 | console.log(dataset); 67 | ``` 68 | 69 | ## Next Steps 70 | 71 | - Learn about [AI concepts](/concepts) and synthetic data generation 72 | - Explore our [platform features](/platform-overview) 73 | - Check out [best practices](/best-practices) for optimal results 74 | - Integrate with our [SDK](/features/sdk) 75 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Syncora Documentation 2 | 3 | This is the documentation site for Syncora, an AI-powered synthetic data generation platform. 4 | 5 | ## Structure 6 | 7 | The documentation is organized into three main sections: 8 | 9 | ### 1. Introduction 10 | 11 | - **Welcome** - Overview of Syncora platform 12 | - **Quick Start** - Get up and running in minutes with product link and login/signup flow 13 | - **Concepts** - Understanding AI and synthetic data generation 14 | - **Best Practices** - Guidelines for optimal results 15 | 16 | ### 2. Platform Overview 17 | 18 | - **Platform Overview** - Complete overview of all features including: 19 | - Synthetic data generation 20 | - Data connectors 21 | - Contribute and earn program 22 | 23 | ### 3. Features 24 | 25 | - **Features** - Technical features and integration guides 26 | - **SDK Installation** - Detailed setup instructions for different platforms 27 | - **API Reference** - Complete API documentation 28 | 29 | ## Development 30 | 31 | ### Getting Started 32 | 33 | 1. Install dependencies: 34 | 35 | ```bash 36 | npm install 37 | ``` 38 | 39 | 2. Start the development server: 40 | 41 | ```bash 42 | npm run dev 43 | ``` 44 | 45 | 3. Open [http://localhost:3000](http://localhost:3000) in your browser. 46 | 47 | ### Content Structure 48 | 49 | All documentation content is located in `content/docs/`: 50 | 51 | - `index.mdx` - Welcome page 52 | - `quick-start.mdx` - Quick start guide 53 | - `concepts.mdx` - AI concepts and synthetic data 54 | - `best-practices.mdx` - Best practices guide 55 | - `platform-overview.mdx` - Platform features overview 56 | - `features.mdx` - Technical features 57 | - `features/sdk.mdx` - SDK installation guide 58 | - `features/api.mdx` - API reference 59 | - `meta.json` - Sidebar organization 60 | 61 | ### Routing 62 | 63 | All documentation is served on the root route (`/`) instead of `/docs` as requested. The sidebar structure is defined in `content/docs/meta.json`. 64 | 65 | ### Customization 66 | 67 | - **Styling**: Modify `src/app/global.css` 68 | - **Layout**: Update `src/app/layout.config.tsx` 69 | - **Components**: Edit `src/mdx-components.tsx` 70 | - **Navigation**: Configure in `content/docs/meta.json` 71 | 72 | ## Deployment 73 | 74 | The site can be deployed to any platform that supports Next.js: 75 | 76 | - **Vercel**: `vercel --prod` 77 | - **Netlify**: `netlify deploy --prod` 78 | - **Static Export**: `npm run build && npm run export` 79 | 80 | ## Contributing 81 | 82 | 1. Create a new branch for your changes 83 | 2. Add or modify content in `content/docs/` 84 | 3. Update `meta.json` if adding new pages 85 | 4. Test locally with `npm run dev` 86 | 5. Submit a pull request 87 | 88 | ## License 89 | 90 | This documentation is part of the Syncora platform. 91 | -------------------------------------------------------------------------------- /content/docs/concepts.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Concepts 3 | description: Understanding AI and synthetic data generation 4 | group: INTRODUCTION 5 | --- 6 | 7 | # AI Concepts & Synthetic Data 8 | 9 | Understanding the fundamentals of AI-powered synthetic data generation will help you make the most of Syncora. 10 | 11 | ## What is Synthetic Data? 12 | 13 | Synthetic data is artificially generated data that mimics the statistical properties and patterns of real data without containing any actual personal or sensitive information. It's created using advanced AI algorithms that learn from existing datasets. 14 | 15 | ## Why Use Synthetic Data? 16 | 17 | ### Privacy & Compliance 18 | 19 | - **GDPR Compliance**: No real personal data means no privacy concerns 20 | - **HIPAA Safe**: Generate medical data without patient information 21 | - **Data Protection**: Eliminate risk of data breaches 22 | 23 | ### Development & Testing 24 | 25 | - **Rapid Prototyping**: Generate datasets instantly for development 26 | - **Testing Scenarios**: Create edge cases and rare scenarios 27 | - **Cost Effective**: No need to collect or purchase real data 28 | 29 | ### Machine Learning 30 | 31 | - **Model Training**: Train AI models with diverse datasets 32 | - **Data Augmentation**: Expand limited datasets 33 | - **Bias Reduction**: Create balanced datasets 34 | 35 | ## How AI Generates Synthetic Data 36 | 37 | ### 1. Pattern Recognition 38 | 39 | Our AI models analyze your existing data to understand: 40 | 41 | - Data distributions 42 | - Correlations between fields 43 | - Temporal patterns 44 | - Categorical relationships 45 | 46 | ### 2. Statistical Modeling 47 | 48 | The AI creates mathematical models that capture: 49 | 50 | - Probability distributions 51 | - Conditional dependencies 52 | - Data constraints 53 | - Business rules 54 | 55 | ### 3. Generation Process 56 | 57 | Using the learned patterns, the AI generates: 58 | 59 | - Realistic data values 60 | - Consistent relationships 61 | - Valid data formats 62 | - Appropriate data types 63 | 64 | ## Types of Synthetic Data 65 | 66 | ### Tabular Data 67 | 68 | - **Structured datasets** like user profiles, transactions, inventory 69 | - **Relational data** with foreign key relationships 70 | - **Time series data** with temporal patterns 71 | 72 | ### Text Data 73 | 74 | - **Natural language** that follows grammar rules 75 | - **Domain-specific content** for specialized applications 76 | - **Multi-language support** for global applications 77 | 78 | ### Image Data 79 | 80 | - **Visual content** for computer vision applications 81 | - **Annotated images** for training object detection 82 | - **Style variations** for robust model training 83 | 84 | ## Quality Metrics 85 | 86 | ### Statistical Similarity 87 | 88 | - **Distribution matching** with original data 89 | - **Correlation preservation** between variables 90 | - **Statistical tests** to validate similarity 91 | 92 | ### Data Utility 93 | 94 | - **Model performance** when trained on synthetic data 95 | - **Business logic validation** in generated data 96 | - **Edge case coverage** for comprehensive testing 97 | 98 | ### Privacy Protection 99 | 100 | - **Differential privacy** guarantees 101 | - **Re-identification risk** assessment 102 | - **Data anonymization** verification 103 | 104 | ## Best Practices 105 | 106 | ### Data Preparation 107 | 108 | - Clean and validate your source data 109 | - Remove sensitive information before analysis 110 | - Document your data schema and constraints 111 | 112 | ### Generation Strategy 113 | 114 | - Start with small datasets for validation 115 | - Gradually increase complexity 116 | - Test with your specific use cases 117 | 118 | ### Validation Process 119 | 120 | - Compare statistical properties 121 | - Verify business rule compliance 122 | - Test with your applications 123 | 124 | ## Advanced Concepts 125 | 126 | ### Conditional Generation 127 | 128 | Generate data based on specific conditions or constraints: 129 | 130 | ```javascript 131 | { 132 | users: { 133 | fields: { 134 | age: 'number', 135 | income: 'number' 136 | }, 137 | constraints: { 138 | income: 'age * 1000 + random(5000, 50000)' 139 | } 140 | } 141 | } 142 | ``` 143 | 144 | ### Temporal Patterns 145 | 146 | Create time-series data with realistic patterns: 147 | 148 | ```javascript 149 | { 150 | transactions: { 151 | fields: { 152 | timestamp: 'datetime', 153 | amount: 'number' 154 | }, 155 | patterns: { 156 | seasonal: true, 157 | weekly_cycle: true 158 | } 159 | } 160 | } 161 | ``` 162 | 163 | ### Relationship Preservation 164 | 165 | Maintain referential integrity across tables: 166 | 167 | ```javascript 168 | { 169 | users: { /* user data */ }, 170 | orders: { 171 | fields: { 172 | user_id: 'reference:users.id', 173 | order_date: 'datetime' 174 | } 175 | } 176 | } 177 | ``` 178 | -------------------------------------------------------------------------------- /content/docs/platform-overview.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Platform overview 3 | description: Overview of all Syncora platform features and capabilities 4 | group: PLATFORM 5 | --- 6 | 7 | # Platform overview 8 | 9 | Syncora provides a comprehensive suite of tools for AI-powered synthetic data generation. Explore all the features and capabilities available on our platform. 10 | 11 | ## Core Features 12 | 13 | ### Synthetic Data Generation 14 | 15 | Our flagship feature that enables you to create high-quality synthetic datasets using advanced AI algorithms. 16 | 17 | **Key Capabilities:** 18 | 19 | - **Multi-format support**: Generate tabular, text, and image data 20 | - **Custom schemas**: Define your own data structures and relationships 21 | - **Realistic patterns**: Maintain statistical properties of original data 22 | - **Privacy-safe**: No real personal information in generated data 23 | - **Scalable**: Generate datasets from 100 to millions of records 24 | 25 | **Use Cases:** 26 | 27 | - Machine learning model training 28 | - Application testing and development 29 | - Data privacy compliance 30 | - Research and analytics 31 | 32 | ### Data Connectors 33 | 34 | Seamlessly integrate with your existing data infrastructure and external sources. 35 | 36 | **Supported Sources:** 37 | 38 | - **Databases**: PostgreSQL, MySQL, MongoDB, SQL Server 39 | - **Cloud Storage**: AWS S3, Google Cloud Storage, Azure Blob 40 | - **APIs**: REST APIs, GraphQL endpoints 41 | - **File Formats**: CSV, JSON, Parquet, Excel 42 | - **Streaming**: Kafka, Kinesis, Pub/Sub 43 | 44 | **Features:** 45 | 46 | - **Real-time sync**: Keep data up-to-date automatically 47 | - **Incremental updates**: Only process new or changed data 48 | - **Data transformation**: Clean and format data during import 49 | - **Schema inference**: Automatically detect data structure 50 | - **Error handling**: Robust error recovery and retry logic 51 | 52 | ### Contribute & Earn 53 | 54 | Join our community and earn rewards by contributing to the platform. 55 | 56 | **Contribution Opportunities:** 57 | 58 | - **Data Schemas**: Share well-designed data schemas 59 | - **Use Cases**: Document successful implementations 60 | - **Tutorials**: Create educational content 61 | - **Bug Reports**: Help improve platform quality 62 | - **Feature Requests**: Suggest new capabilities 63 | 64 | **Rewards System:** 65 | 66 | - **Credits**: Earn platform credits for contributions 67 | - **Recognition**: Get featured in our community showcase 68 | - **Early Access**: Try new features before general release 69 | - **Community Status**: Build reputation and influence 70 | 71 | ## Advanced Features 72 | 73 | ### AI-Powered Insights 74 | 75 | Get intelligent recommendations for your data generation projects. 76 | 77 | **Analytics Dashboard:** 78 | 79 | - **Data quality metrics**: Statistical analysis of generated data 80 | - **Usage patterns**: Track your platform usage over time 81 | - **Performance insights**: Optimize your generation strategies 82 | - **Cost analysis**: Monitor your resource consumption 83 | 84 | ### Collaboration Tools 85 | 86 | Work together with your team on data generation projects. 87 | 88 | **Team Features:** 89 | 90 | - **Shared workspaces**: Collaborate on projects 91 | - **Role-based access**: Control permissions and visibility 92 | - **Version control**: Track changes to schemas and datasets 93 | - **Comments and feedback**: Discuss and iterate on projects 94 | 95 | ### Enterprise Features 96 | 97 | Advanced capabilities for large organizations. 98 | 99 | **Enterprise Capabilities:** 100 | 101 | - **SSO Integration**: Connect with your identity provider 102 | - **Audit Logs**: Track all platform activities 103 | - **Custom Branding**: White-label the platform 104 | - **Dedicated Support**: Priority customer service 105 | - **SLA Guarantees**: Performance and uptime commitments 106 | 107 | ## Platform Architecture 108 | 109 | ### Scalable Infrastructure 110 | 111 | Built on modern cloud architecture for reliability and performance. 112 | 113 | **Technical Stack:** 114 | 115 | - **Microservices**: Modular, scalable architecture 116 | - **Kubernetes**: Container orchestration and scaling 117 | - **Redis**: High-performance caching 118 | - **PostgreSQL**: Reliable data storage 119 | - **AWS/GCP**: Multi-cloud deployment 120 | 121 | ### Security & Compliance 122 | 123 | Enterprise-grade security for your data and applications. 124 | 125 | **Security Features:** 126 | 127 | - **End-to-end encryption**: Data encrypted in transit and at rest 128 | - **SOC 2 Type II**: Certified security practices 129 | - **GDPR Compliance**: Privacy-by-design architecture 130 | - **Regular audits**: Third-party security assessments 131 | - **Incident response**: 24/7 security monitoring 132 | 133 | ### API-First Design 134 | 135 | Everything accessible through our comprehensive API. 136 | 137 | **API Capabilities:** 138 | 139 | - **RESTful APIs**: Standard HTTP interfaces 140 | - **GraphQL**: Flexible data querying 141 | - **Webhooks**: Real-time event notifications 142 | - **SDK Libraries**: Easy integration for developers 143 | - **Rate limiting**: Fair usage policies 144 | 145 | ## Getting Started 146 | 147 | ### Choose Your Path 148 | 149 | **For Developers:** 150 | 151 | 1. [Quick start](/quick-start) - Get up and running in minutes 152 | 2. [SDK Installation](/features/sdk) - Integrate with your applications 153 | 3. [API Reference](/features/api) - Explore our APIs 154 | 155 | **For Data Scientists:** 156 | 157 | 1. [Concepts](/concepts) - Understand synthetic data generation 158 | 2. [Best practices](/best-practices) - Learn optimization techniques 159 | 3. [Platform overview](/platform-overview) - Explore all features 160 | 161 | **For Business Users:** 162 | 163 | 1. [Quick start](/quick-start) - Create your first dataset 164 | 2. [Platform overview](/platform-overview) - Understand capabilities 165 | 3. [Features](/features) - Explore integration options 166 | 167 | ### Next Steps 168 | 169 | - **Explore our [Features](/features)** section for detailed guides 170 | - **Check out [Best practices](/best-practices)** for optimization tips 171 | - **Join our [Community](https://community.syncora.ai)** to connect with other users 172 | - **Contact [Sales](https://syncora.ai/contact)** for enterprise solutions 173 | -------------------------------------------------------------------------------- /content/docs/best-practices.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Best practices 3 | description: Guidelines for optimal synthetic data generation 4 | group: INTRODUCTION 5 | --- 6 | 7 | # Best practices 8 | 9 | Follow these guidelines to ensure you get the best results from Syncora's synthetic data generation. 10 | 11 | ## Data Preparation 12 | 13 | ### Clean Your Source Data 14 | 15 | - **Remove duplicates** and inconsistent records 16 | - **Handle missing values** appropriately 17 | - **Standardize formats** (dates, phone numbers, etc.) 18 | - **Validate data types** and ranges 19 | 20 | ### Document Your Schema 21 | 22 | ```javascript 23 | { 24 | users: { 25 | fields: { 26 | id: { type: 'uuid', primary: true }, 27 | name: { type: 'string', minLength: 2, maxLength: 50 }, 28 | email: { type: 'email', unique: true }, 29 | age: { type: 'number', min: 13, max: 120 }, 30 | created_at: { type: 'datetime', default: 'now' } 31 | } 32 | } 33 | } 34 | ``` 35 | 36 | ### Define Business Rules 37 | 38 | - **Constraints**: Age must be positive, email must be valid 39 | - **Relationships**: User orders must reference valid user IDs 40 | - **Dependencies**: Premium users must have verified email 41 | 42 | ## Generation Strategy 43 | 44 | ### Start Small 45 | 46 | 1. **Begin with 100-1000 records** to validate quality 47 | 2. **Test with your applications** before scaling 48 | 3. **Iterate on schema** based on results 49 | 4. **Gradually increase volume** once satisfied 50 | 51 | ### Validate Early 52 | 53 | - **Statistical comparison** with original data 54 | - **Business logic testing** in your applications 55 | - **Edge case verification** for rare scenarios 56 | - **Performance testing** with your systems 57 | 58 | ### Monitor Quality 59 | 60 | - **Distribution analysis** of generated data 61 | - **Correlation preservation** between variables 62 | - **Data format validation** (emails, phone numbers) 63 | - **Referential integrity** checks 64 | 65 | ## Privacy & Security 66 | 67 | ### Data Anonymization 68 | 69 | - **Remove PII** before analysis (names, addresses, SSNs) 70 | - **Hash sensitive fields** that need to be preserved 71 | - **Use synthetic identifiers** instead of real IDs 72 | - **Apply differential privacy** for sensitive datasets 73 | 74 | ### Access Control 75 | 76 | - **Limit API key permissions** to minimum required 77 | - **Rotate API keys** regularly 78 | - **Monitor usage patterns** for anomalies 79 | - **Use environment variables** for API keys 80 | 81 | ### Compliance Considerations 82 | 83 | - **GDPR compliance** for EU data 84 | - **HIPAA requirements** for healthcare data 85 | - **Industry-specific regulations** (PCI DSS, SOX) 86 | - **Data retention policies** for generated data 87 | 88 | ## Performance Optimization 89 | 90 | ### Efficient Schema Design 91 | 92 | ```javascript 93 | // Good: Optimized for generation 94 | { 95 | users: { 96 | fields: { 97 | id: 'uuid', 98 | name: 'string', 99 | email: 'email' 100 | }, 101 | count: 10000 102 | } 103 | } 104 | 105 | // Better: With constraints and relationships 106 | { 107 | users: { 108 | fields: { 109 | id: 'uuid', 110 | name: 'string', 111 | email: 'email', 112 | created_at: 'datetime' 113 | }, 114 | constraints: { 115 | email: 'unique', 116 | created_at: 'after:2020-01-01' 117 | }, 118 | count: 10000 119 | } 120 | } 121 | ``` 122 | 123 | ### Batch Processing 124 | 125 | - **Generate in batches** of 1000-10000 records 126 | - **Use streaming** for large datasets 127 | - **Implement retry logic** for failed requests 128 | - **Monitor memory usage** during generation 129 | 130 | ### Caching Strategy 131 | 132 | - **Cache generated datasets** for reuse 133 | - **Store schema definitions** for quick access 134 | - **Implement versioning** for schema changes 135 | - **Use CDN** for large file downloads 136 | 137 | ## Integration Best Practices 138 | 139 | ### SDK Usage 140 | 141 | ```javascript 142 | import { SyncoraClient } from "@syncora/sdk"; 143 | 144 | const client = new SyncoraClient({ 145 | apiKey: process.env.SYNCORA_API_KEY, 146 | timeout: 30000, 147 | retries: 3, 148 | }); 149 | 150 | // Handle errors gracefully 151 | try { 152 | const dataset = await client.generateData(schema); 153 | console.log("Generated:", dataset.recordCount, "records"); 154 | } catch (error) { 155 | console.error("Generation failed:", error.message); 156 | } 157 | ``` 158 | 159 | ### Error Handling 160 | 161 | - **Validate API responses** before processing 162 | - **Implement exponential backoff** for retries 163 | - **Log errors** with sufficient context 164 | - **Provide user-friendly error messages** 165 | 166 | ### Testing Strategy 167 | 168 | - **Unit tests** for schema validation 169 | - **Integration tests** with your applications 170 | - **Performance tests** for large datasets 171 | - **Regression tests** for schema changes 172 | 173 | ## Quality Assurance 174 | 175 | ### Data Validation 176 | 177 | ```javascript 178 | // Validate generated data 179 | const validationRules = { 180 | users: { 181 | email: (email) => email.includes("@"), 182 | age: (age) => age >= 13 && age <= 120, 183 | name: (name) => name.length >= 2, 184 | }, 185 | }; 186 | 187 | const isValid = validateDataset(dataset, validationRules); 188 | ``` 189 | 190 | ### Statistical Validation 191 | 192 | - **Distribution tests** (Kolmogorov-Smirnov, Chi-square) 193 | - **Correlation analysis** between variables 194 | - **Outlier detection** and handling 195 | - **Data completeness** checks 196 | 197 | ### Business Logic Testing 198 | 199 | - **Test with real applications** and workflows 200 | - **Verify data relationships** and constraints 201 | - **Check edge cases** and boundary conditions 202 | - **Validate data formats** and types 203 | 204 | ## Troubleshooting 205 | 206 | ### Common Issues 207 | 208 | #### Poor Data Quality 209 | 210 | - **Check source data** for inconsistencies 211 | - **Refine schema** with better constraints 212 | - **Increase sample size** for better patterns 213 | - **Add more context** to generation rules 214 | 215 | #### Performance Problems 216 | 217 | - **Reduce batch sizes** for large datasets 218 | - **Optimize schema** by removing unnecessary fields 219 | - **Use streaming** for very large datasets 220 | - **Implement caching** for repeated requests 221 | 222 | #### API Errors 223 | 224 | - **Check API key** validity and permissions 225 | - **Verify schema** syntax and structure 226 | - **Monitor rate limits** and quotas 227 | - **Review error logs** for specific issues 228 | 229 | ### Getting Help 230 | 231 | - **Check documentation** for common solutions 232 | - **Review API status** at status.syncora.ai 233 | - **Contact support** with detailed error information 234 | - **Join community** forums for peer assistance 235 | -------------------------------------------------------------------------------- /content/docs/features.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Features 3 | description: Technical features and integration guides 4 | group: DEVELOPMENT 5 | --- 6 | 7 | # Features 8 | 9 | Explore Syncora's technical features and integration capabilities. From SDKs to APIs, we provide everything you need to integrate synthetic data generation into your applications. 10 | 11 | ## SDK & Libraries 12 | 13 | ### JavaScript/TypeScript SDK 14 | 15 | Our official SDK for Node.js and browser environments. 16 | 17 | **Key Features:** 18 | 19 | - **TypeScript support** with full type definitions 20 | - **Promise-based API** for async operations 21 | - **Error handling** with detailed error messages 22 | - **Retry logic** for network failures 23 | - **Streaming support** for large datasets 24 | 25 | **Installation:** 26 | 27 | ```bash 28 | npm install @syncora/sdk 29 | ``` 30 | 31 | **Quick Start:** 32 | 33 | ```javascript 34 | import { SyncoraClient } from "@syncora/sdk"; 35 | 36 | const client = new SyncoraClient({ 37 | apiKey: "your-api-key", 38 | }); 39 | 40 | const dataset = await client.generateData({ 41 | schema: { 42 | users: { 43 | fields: { 44 | name: "string", 45 | email: "email", 46 | age: "number", 47 | }, 48 | count: 1000, 49 | }, 50 | }, 51 | }); 52 | ``` 53 | 54 | ### Python SDK 55 | 56 | Native Python library for data science and ML workflows. 57 | 58 | **Installation:** 59 | 60 | ```bash 61 | pip install syncora-sdk 62 | ``` 63 | 64 | **Usage:** 65 | 66 | ```python 67 | from syncora import SyncoraClient 68 | 69 | client = SyncoraClient(api_key="your-api-key") 70 | 71 | dataset = client.generate_data({ 72 | "users": { 73 | "fields": { 74 | "name": "string", 75 | "email": "email", 76 | "age": "number" 77 | }, 78 | "count": 1000 79 | } 80 | }) 81 | ``` 82 | 83 | ### REST API 84 | 85 | Direct HTTP access to all platform features. 86 | 87 | **Base URL:** `https://api.syncora.ai/v1` 88 | 89 | **Authentication:** 90 | 91 | ```bash 92 | curl -H "Authorization: Bearer YOUR_API_KEY" \ 93 | https://api.syncora.ai/v1/datasets 94 | ``` 95 | 96 | ## API Key Management 97 | 98 | ### Generating API Keys 99 | 100 | 1. **Login** to your Syncora account 101 | 2. **Navigate** to Settings → API Keys 102 | 3. **Click** "Generate New API Key" 103 | 4. **Name** your key descriptively 104 | 5. **Copy** and store securely 105 | 106 | ### Key Permissions 107 | 108 | - **Read**: Access to view datasets and schemas 109 | - **Write**: Create and modify datasets 110 | - **Admin**: Full account management access 111 | 112 | ### Security Best Practices 113 | 114 | - **Store keys securely** in environment variables 115 | - **Rotate keys regularly** (every 90 days) 116 | - **Use different keys** for different environments 117 | - **Monitor usage** for unusual activity 118 | 119 | ## Data Generation 120 | 121 | ### Schema Definition 122 | 123 | Define your data structure with our flexible schema language. 124 | 125 | **Basic Schema:** 126 | 127 | ```javascript 128 | { 129 | users: { 130 | fields: { 131 | id: 'uuid', 132 | name: 'string', 133 | email: 'email', 134 | age: 'number', 135 | created_at: 'datetime' 136 | }, 137 | count: 1000 138 | } 139 | } 140 | ``` 141 | 142 | **Advanced Schema:** 143 | 144 | ```javascript 145 | { 146 | users: { 147 | fields: { 148 | id: 'uuid', 149 | name: 'string', 150 | email: 'email', 151 | age: 'number', 152 | income: 'number', 153 | city: 'string' 154 | }, 155 | constraints: { 156 | age: 'min:18, max:100', 157 | income: 'min:20000, max:200000', 158 | email: 'unique' 159 | }, 160 | relationships: { 161 | orders: 'has_many' 162 | }, 163 | count: 1000 164 | }, 165 | orders: { 166 | fields: { 167 | id: 'uuid', 168 | user_id: 'reference:users.id', 169 | amount: 'number', 170 | status: 'enum:pending,completed,cancelled', 171 | created_at: 'datetime' 172 | }, 173 | count: 5000 174 | } 175 | } 176 | ``` 177 | 178 | ### Data Types 179 | 180 | - **Primitive Types**: string, number, boolean, datetime 181 | - **Special Types**: email, phone, uuid, url 182 | - **Complex Types**: object, array, enum 183 | - **Reference Types**: reference to other tables 184 | 185 | ### Constraints & Validation 186 | 187 | - **Range constraints**: min/max values 188 | - **Format validation**: email, phone, url patterns 189 | - **Uniqueness**: unique field values 190 | - **Conditional logic**: if/then relationships 191 | 192 | ## Integration Examples 193 | 194 | ### Web Application 195 | 196 | ```javascript 197 | // React component for data generation 198 | import React, { useState } from "react"; 199 | import { SyncoraClient } from "@syncora/sdk"; 200 | 201 | function DataGenerator() { 202 | const [loading, setLoading] = useState(false); 203 | const [data, setData] = useState(null); 204 | 205 | const generateData = async () => { 206 | setLoading(true); 207 | try { 208 | const client = new SyncoraClient({ 209 | apiKey: process.env.REACT_APP_SYNCORA_API_KEY, 210 | }); 211 | 212 | const result = await client.generateData({ 213 | schema: { 214 | users: { 215 | fields: { 216 | name: "string", 217 | email: "email", 218 | age: "number", 219 | }, 220 | count: 100, 221 | }, 222 | }, 223 | }); 224 | 225 | setData(result); 226 | } catch (error) { 227 | console.error("Generation failed:", error); 228 | } finally { 229 | setLoading(false); 230 | } 231 | }; 232 | 233 | return ( 234 |
235 | 238 | {data &&
{JSON.stringify(data, null, 2)}
} 239 |
240 | ); 241 | } 242 | ``` 243 | 244 | ### Data Pipeline 245 | 246 | ```python 247 | # Python script for automated data generation 248 | import pandas as pd 249 | from syncora import SyncoraClient 250 | import schedule 251 | import time 252 | 253 | def generate_daily_dataset(): 254 | client = SyncoraClient(api_key="your-api-key") 255 | 256 | schema = { 257 | "transactions": { 258 | "fields": { 259 | "id": "uuid", 260 | "amount": "number", 261 | "category": "string", 262 | "timestamp": "datetime" 263 | }, 264 | "count": 10000 265 | } 266 | } 267 | 268 | dataset = client.generate_data(schema) 269 | 270 | # Convert to DataFrame 271 | df = pd.DataFrame(dataset['transactions']) 272 | 273 | # Save to file 274 | df.to_csv(f"transactions_{pd.Timestamp.now().date()}.csv", index=False) 275 | print(f"Generated {len(df)} transactions") 276 | 277 | # Schedule daily generation 278 | schedule.every().day.at("00:00").do(generate_daily_dataset) 279 | 280 | while True: 281 | schedule.run_pending() 282 | time.sleep(60) 283 | ``` 284 | 285 | ### Machine Learning Workflow 286 | 287 | ```python 288 | # ML pipeline with synthetic data 289 | import numpy as np 290 | from sklearn.model_selection import train_test_split 291 | from sklearn.ensemble import RandomForestClassifier 292 | from syncora import SyncoraClient 293 | 294 | # Generate training data 295 | client = SyncoraClient(api_key="your-api-key") 296 | 297 | training_schema = { 298 | "customers": { 299 | "fields": { 300 | "age": "number", 301 | "income": "number", 302 | "credit_score": "number", 303 | "purchase_amount": "number", 304 | "churned": "boolean" 305 | }, 306 | "count": 10000 307 | } 308 | } 309 | 310 | training_data = client.generate_data(training_schema) 311 | df = pd.DataFrame(training_data['customers']) 312 | 313 | # Prepare features and target 314 | X = df[['age', 'income', 'credit_score', 'purchase_amount']] 315 | y = df['churned'] 316 | 317 | # Split and train 318 | X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) 319 | model = RandomForestClassifier() 320 | model.fit(X_train, y_train) 321 | 322 | # Evaluate 323 | accuracy = model.score(X_test, y_test) 324 | print(f"Model accuracy: {accuracy:.2f}") 325 | ``` 326 | 327 | ## Advanced Features 328 | 329 | ### Streaming Data 330 | 331 | Generate large datasets without memory issues. 332 | 333 | ```javascript 334 | const stream = await client.generateDataStream({ 335 | schema: { 336 | users: { 337 | fields: { 338 | /* ... */ 339 | }, 340 | count: 1000000, 341 | }, 342 | }, 343 | }); 344 | 345 | for await (const batch of stream) { 346 | console.log(`Received ${batch.length} records`); 347 | // Process batch 348 | } 349 | ``` 350 | 351 | ### Custom Generators 352 | 353 | Define your own data generation logic. 354 | 355 | ```javascript 356 | const customGenerator = { 357 | name: "custom_user", 358 | generate: (context) => { 359 | const firstName = context.faker.name.firstName(); 360 | const lastName = context.faker.name.lastName(); 361 | return { 362 | name: `${firstName} ${lastName}`, 363 | email: `${firstName.toLowerCase()}.${lastName.toLowerCase()}@example.com`, 364 | age: context.faker.datatype.number({ min: 18, max: 80 }), 365 | }; 366 | }, 367 | }; 368 | 369 | const dataset = await client.generateData({ 370 | schema: { 371 | users: { 372 | generator: "custom_user", 373 | count: 1000, 374 | }, 375 | }, 376 | generators: [customGenerator], 377 | }); 378 | ``` 379 | 380 | ### Data Export Formats 381 | 382 | - **JSON**: Standard JavaScript object notation 383 | - **CSV**: Comma-separated values 384 | - **Parquet**: Columnar storage format 385 | - **SQL**: Database insert statements 386 | - **Excel**: Spreadsheet format 387 | 388 | ## Error Handling 389 | 390 | ### Common Errors 391 | 392 | ```javascript 393 | try { 394 | const dataset = await client.generateData(schema); 395 | } catch (error) { 396 | switch (error.code) { 397 | case "INVALID_SCHEMA": 398 | console.error("Schema validation failed:", error.details); 399 | break; 400 | case "RATE_LIMIT_EXCEEDED": 401 | console.error("Rate limit exceeded, retry later"); 402 | break; 403 | case "INSUFFICIENT_QUOTA": 404 | console.error("Account quota exceeded"); 405 | break; 406 | default: 407 | console.error("Unexpected error:", error.message); 408 | } 409 | } 410 | ``` 411 | 412 | ### Retry Logic 413 | 414 | ```javascript 415 | import { retry } from "@syncora/sdk/utils"; 416 | 417 | const generateWithRetry = retry(client.generateData, { 418 | maxAttempts: 3, 419 | backoff: "exponential", 420 | baseDelay: 1000, 421 | }); 422 | 423 | const dataset = await generateWithRetry(schema); 424 | ``` 425 | 426 | ## Performance Optimization 427 | 428 | ### Batch Processing 429 | 430 | ```javascript 431 | // Generate data in batches 432 | const batchSize = 10000; 433 | const totalRecords = 100000; 434 | const batches = []; 435 | 436 | for (let i = 0; i < totalRecords; i += batchSize) { 437 | const batch = await client.generateData({ 438 | schema: { 439 | users: { 440 | fields: { 441 | /* ... */ 442 | }, 443 | count: Math.min(batchSize, totalRecords - i), 444 | }, 445 | }, 446 | }); 447 | batches.push(batch); 448 | } 449 | ``` 450 | 451 | ### Caching 452 | 453 | ```javascript 454 | // Cache generated datasets 455 | const cache = new Map(); 456 | 457 | async function getCachedDataset(schema, cacheKey) { 458 | if (cache.has(cacheKey)) { 459 | return cache.get(cacheKey); 460 | } 461 | 462 | const dataset = await client.generateData(schema); 463 | cache.set(cacheKey, dataset); 464 | return dataset; 465 | } 466 | ``` 467 | 468 | ## Next Steps 469 | 470 | - **Explore [SDK Installation](/features/sdk)** for detailed setup guides 471 | - **Check [API Reference](/features/api)** for complete API documentation 472 | - **Review [Best practices](/best-practices)** for optimization tips 473 | - **Join our [Community](https://community.syncora.ai)** for support 474 | -------------------------------------------------------------------------------- /content/docs/features/api.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: API reference 3 | description: Complete API documentation for Syncora 4 | group: DEVELOPMENT 5 | --- 6 | 7 | # API reference 8 | 9 | Complete documentation for Syncora's REST API. All endpoints return JSON responses and use standard HTTP status codes. 10 | 11 | ## Base URL 12 | 13 | ``` 14 | https://api.syncora.ai/v1 15 | ``` 16 | 17 | ## Authentication 18 | 19 | All API requests require authentication using an API key in the Authorization header: 20 | 21 | ```bash 22 | Authorization: Bearer YOUR_API_KEY 23 | ``` 24 | 25 | ### Getting Your API Key 26 | 27 | 1. Log in to your [Syncora account](https://app.syncora.ai) 28 | 2. Navigate to **Settings** → **API Keys** 29 | 3. Click **"Generate New API Key"** 30 | 4. Copy the generated key and store it securely 31 | 32 | ## Rate Limits 33 | 34 | - **Free tier**: 100 requests per hour 35 | - **Pro tier**: 1,000 requests per hour 36 | - **Enterprise**: Custom limits 37 | 38 | Rate limit headers are included in responses: 39 | 40 | ``` 41 | X-RateLimit-Limit: 1000 42 | X-RateLimit-Remaining: 999 43 | X-RateLimit-Reset: 1640995200 44 | ``` 45 | 46 | ## Data Generation 47 | 48 | ### Generate Data 49 | 50 | Generate synthetic data based on a schema definition. 51 | 52 | **Endpoint:** `POST /datasets` 53 | 54 | **Request Body:** 55 | 56 | ```json 57 | { 58 | "schema": { 59 | "users": { 60 | "fields": { 61 | "id": "uuid", 62 | "name": "string", 63 | "email": "email", 64 | "age": "number", 65 | "created_at": "datetime" 66 | }, 67 | "count": 1000, 68 | "constraints": { 69 | "age": "min:18, max:100", 70 | "email": "unique" 71 | } 72 | } 73 | }, 74 | "options": { 75 | "format": "json", 76 | "include_metadata": true 77 | } 78 | } 79 | ``` 80 | 81 | **Response:** 82 | 83 | ```json 84 | { 85 | "id": "ds_1234567890", 86 | "status": "completed", 87 | "created_at": "2024-01-15T10:30:00Z", 88 | "schema": { 89 | "users": { 90 | "fields": { 91 | "id": "uuid", 92 | "name": "string", 93 | "email": "email", 94 | "age": "number", 95 | "created_at": "datetime" 96 | }, 97 | "count": 1000 98 | } 99 | }, 100 | "data": { 101 | "users": [ 102 | { 103 | "id": "550e8400-e29b-41d4-a716-446655440000", 104 | "name": "John Doe", 105 | "email": "john.doe@example.com", 106 | "age": 32, 107 | "created_at": "2024-01-15T10:30:00Z" 108 | } 109 | ] 110 | }, 111 | "metadata": { 112 | "total_records": 1000, 113 | "generation_time": 2.5, 114 | "quality_score": 0.95 115 | } 116 | } 117 | ``` 118 | 119 | **cURL Example:** 120 | 121 | ```bash 122 | curl -X POST https://api.syncora.ai/v1/datasets \ 123 | -H "Authorization: Bearer YOUR_API_KEY" \ 124 | -H "Content-Type: application/json" \ 125 | -d '{ 126 | "schema": { 127 | "users": { 128 | "fields": { 129 | "name": "string", 130 | "email": "email", 131 | "age": "number" 132 | }, 133 | "count": 100 134 | } 135 | } 136 | }' 137 | ``` 138 | 139 | ### Get Dataset Status 140 | 141 | Check the status of a data generation job. 142 | 143 | **Endpoint:** `GET /datasets/{dataset_id}` 144 | 145 | **Response:** 146 | 147 | ```json 148 | { 149 | "id": "ds_1234567890", 150 | "status": "processing", 151 | "progress": 75, 152 | "created_at": "2024-01-15T10:30:00Z", 153 | "estimated_completion": "2024-01-15T10:32:00Z" 154 | } 155 | ``` 156 | 157 | ### List Datasets 158 | 159 | Get a list of your generated datasets. 160 | 161 | **Endpoint:** `GET /datasets` 162 | 163 | **Query Parameters:** 164 | 165 | - `limit` (optional): Number of datasets to return (default: 20, max: 100) 166 | - `offset` (optional): Number of datasets to skip (default: 0) 167 | - `status` (optional): Filter by status (pending, processing, completed, failed) 168 | 169 | **Response:** 170 | 171 | ```json 172 | { 173 | "datasets": [ 174 | { 175 | "id": "ds_1234567890", 176 | "name": "User Dataset", 177 | "status": "completed", 178 | "created_at": "2024-01-15T10:30:00Z", 179 | "record_count": 1000, 180 | "schema_summary": { 181 | "tables": ["users"], 182 | "total_fields": 5 183 | } 184 | } 185 | ], 186 | "pagination": { 187 | "total": 150, 188 | "limit": 20, 189 | "offset": 0, 190 | "has_more": true 191 | } 192 | } 193 | ``` 194 | 195 | ### Download Dataset 196 | 197 | Download a completed dataset in various formats. 198 | 199 | **Endpoint:** `GET /datasets/{dataset_id}/download` 200 | 201 | **Query Parameters:** 202 | 203 | - `format` (optional): Export format (json, csv, parquet, sql, excel) 204 | 205 | **Response Headers:** 206 | 207 | ``` 208 | Content-Type: application/json 209 | Content-Disposition: attachment; filename="dataset_1234567890.json" 210 | ``` 211 | 212 | ## Schema Management 213 | 214 | ### Validate Schema 215 | 216 | Validate a schema definition before generation. 217 | 218 | **Endpoint:** `POST /schemas/validate` 219 | 220 | **Request Body:** 221 | 222 | ```json 223 | { 224 | "schema": { 225 | "users": { 226 | "fields": { 227 | "id": "uuid", 228 | "name": "string", 229 | "email": "email" 230 | }, 231 | "count": 100 232 | } 233 | } 234 | } 235 | ``` 236 | 237 | **Response:** 238 | 239 | ```json 240 | { 241 | "valid": true, 242 | "warnings": [ 243 | "Field 'email' should have 'unique' constraint for better data quality" 244 | ], 245 | "estimated_records": 100, 246 | "estimated_size_mb": 0.5 247 | } 248 | ``` 249 | 250 | ### Get Schema Templates 251 | 252 | Get predefined schema templates for common use cases. 253 | 254 | **Endpoint:** `GET /schemas/templates` 255 | 256 | **Response:** 257 | 258 | ```json 259 | { 260 | "templates": [ 261 | { 262 | "id": "ecommerce", 263 | "name": "E-commerce Dataset", 264 | "description": "Complete e-commerce dataset with users, products, and orders", 265 | "schema": { 266 | "users": { 267 | "fields": { 268 | "id": "uuid", 269 | "name": "string", 270 | "email": "email", 271 | "address": "string" 272 | }, 273 | "count": 1000 274 | }, 275 | "products": { 276 | "fields": { 277 | "id": "uuid", 278 | "name": "string", 279 | "price": "number", 280 | "category": "string" 281 | }, 282 | "count": 500 283 | }, 284 | "orders": { 285 | "fields": { 286 | "id": "uuid", 287 | "user_id": "reference:users.id", 288 | "product_id": "reference:products.id", 289 | "quantity": "number", 290 | "total": "number" 291 | }, 292 | "count": 2000 293 | } 294 | } 295 | } 296 | ] 297 | } 298 | ``` 299 | 300 | ## Data Connectors 301 | 302 | ### List Connectors 303 | 304 | Get available data connectors. 305 | 306 | **Endpoint:** `GET /connectors` 307 | 308 | **Response:** 309 | 310 | ```json 311 | { 312 | "connectors": [ 313 | { 314 | "id": "postgresql", 315 | "name": "PostgreSQL", 316 | "description": "Connect to PostgreSQL databases", 317 | "config_schema": { 318 | "host": "string", 319 | "port": "number", 320 | "database": "string", 321 | "username": "string", 322 | "password": "string" 323 | } 324 | }, 325 | { 326 | "id": "s3", 327 | "name": "Amazon S3", 328 | "description": "Connect to S3 buckets", 329 | "config_schema": { 330 | "bucket": "string", 331 | "region": "string", 332 | "access_key": "string", 333 | "secret_key": "string" 334 | } 335 | } 336 | ] 337 | } 338 | ``` 339 | 340 | ### Create Connection 341 | 342 | Create a new data connection. 343 | 344 | **Endpoint:** `POST /connectors/{connector_id}/connections` 345 | 346 | **Request Body:** 347 | 348 | ```json 349 | { 350 | "name": "My PostgreSQL DB", 351 | "config": { 352 | "host": "localhost", 353 | "port": 5432, 354 | "database": "mydb", 355 | "username": "user", 356 | "password": "password" 357 | } 358 | } 359 | ``` 360 | 361 | **Response:** 362 | 363 | ```json 364 | { 365 | "id": "conn_1234567890", 366 | "name": "My PostgreSQL DB", 367 | "connector_id": "postgresql", 368 | "status": "connected", 369 | "created_at": "2024-01-15T10:30:00Z", 370 | "tables": [ 371 | { 372 | "name": "users", 373 | "columns": [ 374 | { "name": "id", "type": "uuid" }, 375 | { "name": "name", "type": "string" }, 376 | { "name": "email", "type": "string" } 377 | ] 378 | } 379 | ] 380 | } 381 | ``` 382 | 383 | ### Import Data 384 | 385 | Import data from a connected source. 386 | 387 | **Endpoint:** `POST /connectors/connections/{connection_id}/import` 388 | 389 | **Request Body:** 390 | 391 | ```json 392 | { 393 | "tables": ["users", "orders"], 394 | "options": { 395 | "sample_size": 1000, 396 | "include_sensitive": false 397 | } 398 | } 399 | ``` 400 | 401 | **Response:** 402 | 403 | ```json 404 | { 405 | "import_id": "imp_1234567890", 406 | "status": "processing", 407 | "tables": [ 408 | { 409 | "name": "users", 410 | "record_count": 1000, 411 | "sample_data": [ 412 | { 413 | "id": "550e8400-e29b-41d4-a716-446655440000", 414 | "name": "John Doe", 415 | "email": "john@example.com" 416 | } 417 | ] 418 | } 419 | ] 420 | } 421 | ``` 422 | 423 | ## Account Management 424 | 425 | ### Get Account Info 426 | 427 | Get information about your account. 428 | 429 | **Endpoint:** `GET /account` 430 | 431 | **Response:** 432 | 433 | ```json 434 | { 435 | "id": "acc_1234567890", 436 | "email": "user@example.com", 437 | "plan": "pro", 438 | "usage": { 439 | "datasets_generated": 150, 440 | "records_generated": 50000, 441 | "api_calls": 2500 442 | }, 443 | "limits": { 444 | "datasets_per_month": 1000, 445 | "records_per_month": 1000000, 446 | "api_calls_per_hour": 1000 447 | }, 448 | "created_at": "2024-01-01T00:00:00Z" 449 | } 450 | ``` 451 | 452 | ### Get API Keys 453 | 454 | List your API keys. 455 | 456 | **Endpoint:** `GET /account/api-keys` 457 | 458 | **Response:** 459 | 460 | ```json 461 | { 462 | "api_keys": [ 463 | { 464 | "id": "key_1234567890", 465 | "name": "Production API Key", 466 | "created_at": "2024-01-01T00:00:00Z", 467 | "last_used": "2024-01-15T10:30:00Z", 468 | "permissions": ["read", "write"] 469 | } 470 | ] 471 | } 472 | ``` 473 | 474 | ### Create API Key 475 | 476 | Generate a new API key. 477 | 478 | **Endpoint:** `POST /account/api-keys` 479 | 480 | **Request Body:** 481 | 482 | ```json 483 | { 484 | "name": "Development API Key", 485 | "permissions": ["read", "write"] 486 | } 487 | ``` 488 | 489 | **Response:** 490 | 491 | ```json 492 | { 493 | "id": "key_1234567890", 494 | "name": "Development API Key", 495 | "key": "sk_1234567890abcdef...", 496 | "created_at": "2024-01-15T10:30:00Z", 497 | "permissions": ["read", "write"] 498 | } 499 | ``` 500 | 501 | ## Error Responses 502 | 503 | All errors follow a consistent format: 504 | 505 | ```json 506 | { 507 | "error": { 508 | "code": "INVALID_SCHEMA", 509 | "message": "Schema validation failed", 510 | "details": { 511 | "field": "users.email", 512 | "issue": "Invalid email format" 513 | } 514 | } 515 | } 516 | ``` 517 | 518 | ### Common Error Codes 519 | 520 | - `INVALID_API_KEY`: API key is invalid or expired 521 | - `RATE_LIMIT_EXCEEDED`: Rate limit exceeded 522 | - `INVALID_SCHEMA`: Schema validation failed 523 | - `QUOTA_EXCEEDED`: Account quota exceeded 524 | - `DATASET_NOT_FOUND`: Dataset not found 525 | - `CONNECTION_FAILED`: Data connection failed 526 | - `INVALID_REQUEST`: Invalid request format 527 | 528 | ## Webhooks 529 | 530 | ### Create Webhook 531 | 532 | Set up webhooks for real-time notifications. 533 | 534 | **Endpoint:** `POST /webhooks` 535 | 536 | **Request Body:** 537 | 538 | ```json 539 | { 540 | "url": "https://your-app.com/webhooks/syncora", 541 | "events": ["dataset.completed", "dataset.failed"], 542 | "secret": "your-webhook-secret" 543 | } 544 | ``` 545 | 546 | **Response:** 547 | 548 | ```json 549 | { 550 | "id": "webhook_1234567890", 551 | "url": "https://your-app.com/webhooks/syncora", 552 | "events": ["dataset.completed", "dataset.failed"], 553 | "status": "active", 554 | "created_at": "2024-01-15T10:30:00Z" 555 | } 556 | ``` 557 | 558 | ### Webhook Payload 559 | 560 | When a webhook event occurs, a POST request is sent to your URL: 561 | 562 | ```json 563 | { 564 | "event": "dataset.completed", 565 | "timestamp": "2024-01-15T10:30:00Z", 566 | "data": { 567 | "dataset_id": "ds_1234567890", 568 | "status": "completed", 569 | "record_count": 1000 570 | }, 571 | "signature": "sha256=..." 572 | } 573 | ``` 574 | 575 | ## SDK Libraries 576 | 577 | ### JavaScript/TypeScript 578 | 579 | ```bash 580 | npm install @syncora/sdk 581 | ``` 582 | 583 | ```javascript 584 | import { SyncoraClient } from "@syncora/sdk"; 585 | 586 | const client = new SyncoraClient({ 587 | apiKey: "your-api-key", 588 | }); 589 | 590 | const dataset = await client.generateData({ 591 | schema: { 592 | users: { 593 | fields: { 594 | name: "string", 595 | email: "email", 596 | age: "number", 597 | }, 598 | count: 1000, 599 | }, 600 | }, 601 | }); 602 | ``` 603 | 604 | ### Python 605 | 606 | ```bash 607 | pip install syncora-sdk 608 | ``` 609 | 610 | ```python 611 | from syncora import SyncoraClient 612 | 613 | client = SyncoraClient(api_key="your-api-key") 614 | 615 | dataset = client.generate_data({ 616 | "users": { 617 | "fields": { 618 | "name": "string", 619 | "email": "email", 620 | "age": "number" 621 | }, 622 | "count": 1000 623 | } 624 | }) 625 | ``` 626 | 627 | ## Rate Limiting 628 | 629 | When you exceed your rate limit, the API returns: 630 | 631 | ```json 632 | { 633 | "error": { 634 | "code": "RATE_LIMIT_EXCEEDED", 635 | "message": "Rate limit exceeded", 636 | "retry_after": 3600 637 | } 638 | } 639 | ``` 640 | 641 | Include the `Retry-After` header value in your retry logic. 642 | 643 | ## Pagination 644 | 645 | List endpoints support pagination using `limit` and `offset` parameters: 646 | 647 | ```bash 648 | GET /datasets?limit=20&offset=40 649 | ``` 650 | 651 | Response includes pagination metadata: 652 | 653 | ```json 654 | { 655 | "data": [...], 656 | "pagination": { 657 | "total": 150, 658 | "limit": 20, 659 | "offset": 40, 660 | "has_more": true 661 | } 662 | } 663 | ``` 664 | 665 | ## Next Steps 666 | 667 | - **Get started** with our [Quick start](/quick-start) guide 668 | - **Install the SDK** using our [SDK installation](/features/sdk) guide 669 | - **Learn best practices** for optimal API usage 670 | - **Join our community** for support and updates 671 | -------------------------------------------------------------------------------- /content/docs/features/sdk.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: SDK installation 3 | description: Install and set up Syncora SDKs for your platform 4 | group: DEVELOPMENT 5 | --- 6 | 7 | # SDK installation 8 | 9 | Get started with Syncora SDKs for your preferred programming language and platform. 10 | 11 | ## JavaScript/TypeScript SDK 12 | 13 | ### Prerequisites 14 | 15 | - Node.js 16+ or modern browser 16 | - npm, yarn, or pnpm package manager 17 | - Syncora API key 18 | 19 | ### Installation 20 | 21 | **Using npm:** 22 | 23 | ```bash 24 | npm install @syncora/sdk 25 | ``` 26 | 27 | **Using yarn:** 28 | 29 | ```bash 30 | yarn add @syncora/sdk 31 | ``` 32 | 33 | **Using pnpm:** 34 | 35 | ```bash 36 | pnpm add @syncora/sdk 37 | ``` 38 | 39 | ### Basic Setup 40 | 41 | ```javascript 42 | import { SyncoraClient } from "@syncora/sdk"; 43 | 44 | const client = new SyncoraClient({ 45 | apiKey: "your-api-key-here", 46 | }); 47 | ``` 48 | 49 | ### Environment Variables 50 | 51 | **For Node.js applications:** 52 | 53 | ```bash 54 | # .env file 55 | SYNCORA_API_KEY=your-api-key-here 56 | ``` 57 | 58 | ```javascript 59 | // app.js 60 | import { SyncoraClient } from "@syncora/sdk"; 61 | 62 | const client = new SyncoraClient({ 63 | apiKey: process.env.SYNCORA_API_KEY, 64 | }); 65 | ``` 66 | 67 | **For browser applications:** 68 | 69 | ```javascript 70 | // Use environment variables in build process 71 | const client = new SyncoraClient({ 72 | apiKey: process.env.REACT_APP_SYNCORA_API_KEY // for Create React App 73 | // or 74 | apiKey: import.meta.env.VITE_SYNCORA_API_KEY // for Vite 75 | }); 76 | ``` 77 | 78 | ### TypeScript Support 79 | 80 | The SDK includes full TypeScript definitions: 81 | 82 | ```typescript 83 | import { SyncoraClient, GenerateDataOptions, Dataset } from "@syncora/sdk"; 84 | 85 | const client = new SyncoraClient({ 86 | apiKey: process.env.SYNCORA_API_KEY!, 87 | }); 88 | 89 | interface User { 90 | id: string; 91 | name: string; 92 | email: string; 93 | age: number; 94 | } 95 | 96 | const options: GenerateDataOptions = { 97 | schema: { 98 | users: { 99 | fields: { 100 | id: "uuid", 101 | name: "string", 102 | email: "email", 103 | age: "number", 104 | }, 105 | count: 1000, 106 | }, 107 | }, 108 | }; 109 | 110 | const dataset: Dataset = await client.generateData(options); 111 | ``` 112 | 113 | ## Python SDK 114 | 115 | ### Prerequisites 116 | 117 | - Python 3.8+ 118 | - pip package manager 119 | - Syncora API key 120 | 121 | ### Installation 122 | 123 | **Using pip:** 124 | 125 | ```bash 126 | pip install syncora-sdk 127 | ``` 128 | 129 | **Using conda:** 130 | 131 | ```bash 132 | conda install -c conda-forge syncora-sdk 133 | ``` 134 | 135 | **Using poetry:** 136 | 137 | ```bash 138 | poetry add syncora-sdk 139 | ``` 140 | 141 | ### Basic Setup 142 | 143 | ```python 144 | from syncora import SyncoraClient 145 | 146 | client = SyncoraClient(api_key="your-api-key-here") 147 | ``` 148 | 149 | ### Environment Variables 150 | 151 | **Using python-dotenv:** 152 | 153 | ```bash 154 | # .env file 155 | SYNCORA_API_KEY=your-api-key-here 156 | ``` 157 | 158 | ```python 159 | import os 160 | from dotenv import load_dotenv 161 | from syncora import SyncoraClient 162 | 163 | load_dotenv() 164 | 165 | client = SyncoraClient(api_key=os.getenv("SYNCORA_API_KEY")) 166 | ``` 167 | 168 | ### Type Hints 169 | 170 | ```python 171 | from typing import Dict, Any 172 | from syncora import SyncoraClient, Dataset 173 | 174 | client = SyncoraClient(api_key="your-api-key") 175 | 176 | schema: Dict[str, Any] = { 177 | "users": { 178 | "fields": { 179 | "id": "uuid", 180 | "name": "string", 181 | "email": "email", 182 | "age": "number" 183 | }, 184 | "count": 1000 185 | } 186 | } 187 | 188 | dataset: Dataset = client.generate_data(schema) 189 | ``` 190 | 191 | ## React Integration 192 | 193 | ### Installation 194 | 195 | ```bash 196 | npm install @syncora/sdk 197 | ``` 198 | 199 | ### Basic Component 200 | 201 | ```jsx 202 | import React, { useState } from "react"; 203 | import { SyncoraClient } from "@syncora/sdk"; 204 | 205 | function DataGenerator() { 206 | const [loading, setLoading] = useState(false); 207 | const [data, setData] = useState(null); 208 | const [error, setError] = useState(null); 209 | 210 | const generateData = async () => { 211 | setLoading(true); 212 | setError(null); 213 | 214 | try { 215 | const client = new SyncoraClient({ 216 | apiKey: process.env.REACT_APP_SYNCORA_API_KEY, 217 | }); 218 | 219 | const result = await client.generateData({ 220 | schema: { 221 | users: { 222 | fields: { 223 | name: "string", 224 | email: "email", 225 | age: "number", 226 | }, 227 | count: 100, 228 | }, 229 | }, 230 | }); 231 | 232 | setData(result); 233 | } catch (err) { 234 | setError(err.message); 235 | } finally { 236 | setLoading(false); 237 | } 238 | }; 239 | 240 | return ( 241 |
242 | 249 | 250 | {error && ( 251 |
252 | Error: {error} 253 |
254 | )} 255 | 256 | {data && ( 257 |
258 |

Generated Data:

259 |
260 |             {JSON.stringify(data, null, 2)}
261 |           
262 |
263 | )} 264 |
265 | ); 266 | } 267 | 268 | export default DataGenerator; 269 | ``` 270 | 271 | ### Custom Hook 272 | 273 | ```jsx 274 | import { useState, useCallback } from "react"; 275 | import { SyncoraClient } from "@syncora/sdk"; 276 | 277 | export function useSyncora() { 278 | const [loading, setLoading] = useState(false); 279 | const [error, setError] = useState(null); 280 | 281 | const generateData = useCallback(async (schema) => { 282 | setLoading(true); 283 | setError(null); 284 | 285 | try { 286 | const client = new SyncoraClient({ 287 | apiKey: process.env.REACT_APP_SYNCORA_API_KEY, 288 | }); 289 | 290 | const result = await client.generateData({ schema }); 291 | return result; 292 | } catch (err) { 293 | setError(err.message); 294 | throw err; 295 | } finally { 296 | setLoading(false); 297 | } 298 | }, []); 299 | 300 | return { generateData, loading, error }; 301 | } 302 | ``` 303 | 304 | ## Next.js Integration 305 | 306 | ### Installation 307 | 308 | ```bash 309 | npm install @syncora/sdk 310 | ``` 311 | 312 | ### API Route 313 | 314 | ```javascript 315 | // pages/api/generate-data.js 316 | import { SyncoraClient } from "@syncora/sdk"; 317 | 318 | export default async function handler(req, res) { 319 | if (req.method !== "POST") { 320 | return res.status(405).json({ message: "Method not allowed" }); 321 | } 322 | 323 | try { 324 | const client = new SyncoraClient({ 325 | apiKey: process.env.SYNCORA_API_KEY, 326 | }); 327 | 328 | const { schema } = req.body; 329 | const dataset = await client.generateData({ schema }); 330 | 331 | res.status(200).json(dataset); 332 | } catch (error) { 333 | res.status(500).json({ 334 | error: error.message, 335 | }); 336 | } 337 | } 338 | ``` 339 | 340 | ### Client Component 341 | 342 | ```jsx 343 | // components/DataGenerator.js 344 | "use client"; 345 | 346 | import { useState } from "react"; 347 | 348 | export default function DataGenerator() { 349 | const [loading, setLoading] = useState(false); 350 | const [data, setData] = useState(null); 351 | 352 | const generateData = async () => { 353 | setLoading(true); 354 | 355 | try { 356 | const response = await fetch("/api/generate-data", { 357 | method: "POST", 358 | headers: { 359 | "Content-Type": "application/json", 360 | }, 361 | body: JSON.stringify({ 362 | schema: { 363 | users: { 364 | fields: { 365 | name: "string", 366 | email: "email", 367 | age: "number", 368 | }, 369 | count: 100, 370 | }, 371 | }, 372 | }), 373 | }); 374 | 375 | const result = await response.json(); 376 | setData(result); 377 | } catch (error) { 378 | console.error("Generation failed:", error); 379 | } finally { 380 | setLoading(false); 381 | } 382 | }; 383 | 384 | return ( 385 |
386 | 389 | {data &&
{JSON.stringify(data, null, 2)}
} 390 |
391 | ); 392 | } 393 | ``` 394 | 395 | ## Vue.js Integration 396 | 397 | ### Installation 398 | 399 | ```bash 400 | npm install @syncora/sdk 401 | ``` 402 | 403 | ### Component 404 | 405 | ```vue 406 | 428 | 429 | 472 | ``` 473 | 474 | ## Angular Integration 475 | 476 | ### Installation 477 | 478 | ```bash 479 | npm install @syncora/sdk 480 | ``` 481 | 482 | ### Service 483 | 484 | ```typescript 485 | // services/syncora.service.ts 486 | import { Injectable } from "@angular/core"; 487 | import { SyncoraClient } from "@syncora/sdk"; 488 | import { environment } from "../environments/environment"; 489 | 490 | @Injectable({ 491 | providedIn: "root", 492 | }) 493 | export class SyncoraService { 494 | private client: SyncoraClient; 495 | 496 | constructor() { 497 | this.client = new SyncoraClient({ 498 | apiKey: environment.syncoraApiKey, 499 | }); 500 | } 501 | 502 | async generateData(schema: any) { 503 | return await this.client.generateData({ schema }); 504 | } 505 | } 506 | ``` 507 | 508 | ### Component 509 | 510 | ```typescript 511 | // components/data-generator.component.ts 512 | import { Component } from "@angular/core"; 513 | import { SyncoraService } from "../services/syncora.service"; 514 | 515 | @Component({ 516 | selector: "app-data-generator", 517 | template: ` 518 | 525 | 526 |
527 | Error: {{ error }} 528 |
529 | 530 |
531 |

Generated Data:

532 |
533 |         {{ data | json }}
534 |       
536 |
537 | `, 538 | }) 539 | export class DataGeneratorComponent { 540 | loading = false; 541 | data: any = null; 542 | error: string | null = null; 543 | 544 | constructor(private syncoraService: SyncoraService) {} 545 | 546 | async generateData() { 547 | this.loading = true; 548 | this.error = null; 549 | 550 | try { 551 | this.data = await this.syncoraService.generateData({ 552 | users: { 553 | fields: { 554 | name: "string", 555 | email: "email", 556 | age: "number", 557 | }, 558 | count: 100, 559 | }, 560 | }); 561 | } catch (err: any) { 562 | this.error = err.message; 563 | } finally { 564 | this.loading = false; 565 | } 566 | } 567 | } 568 | ``` 569 | 570 | ## Configuration Options 571 | 572 | ### Client Configuration 573 | 574 | ```javascript 575 | const client = new SyncoraClient({ 576 | apiKey: "your-api-key", 577 | timeout: 30000, // 30 seconds 578 | retries: 3, 579 | baseUrl: "https://api.syncora.ai/v1", // optional 580 | headers: { 581 | "User-Agent": "MyApp/1.0", 582 | }, 583 | }); 584 | ``` 585 | 586 | ### Environment-Specific Configuration 587 | 588 | ```javascript 589 | // config/syncora.js 590 | const config = { 591 | development: { 592 | apiKey: process.env.SYNCORA_API_KEY, 593 | timeout: 60000, 594 | retries: 5, 595 | }, 596 | production: { 597 | apiKey: process.env.SYNCORA_API_KEY, 598 | timeout: 30000, 599 | retries: 3, 600 | }, 601 | test: { 602 | apiKey: "test-api-key", 603 | timeout: 5000, 604 | retries: 1, 605 | }, 606 | }; 607 | 608 | export const syncoraConfig = config[process.env.NODE_ENV || "development"]; 609 | ``` 610 | 611 | ## Troubleshooting 612 | 613 | ### Common Issues 614 | 615 | **Module not found errors:** 616 | 617 | ```bash 618 | # Clear cache and reinstall 619 | rm -rf node_modules package-lock.json 620 | npm install 621 | ``` 622 | 623 | **API key not working:** 624 | 625 | - Verify the API key is correct 626 | - Check if the key has the required permissions 627 | - Ensure the key is not expired 628 | 629 | **Network errors:** 630 | 631 | - Check your internet connection 632 | - Verify firewall settings 633 | - Try increasing timeout values 634 | 635 | **TypeScript errors:** 636 | 637 | ```bash 638 | # Install types if needed 639 | npm install @types/node 640 | ``` 641 | 642 | ### Getting Help 643 | 644 | - **Documentation**: Check our [API Reference](/features/api) 645 | - **Examples**: See [Integration Examples](/features#integration-examples) 646 | - **Community**: Join our [Discord](https://discord.gg/syncora) 647 | - **Support**: Contact [support@syncora.ai](mailto:support@syncora.ai) 648 | 649 | ## Next Steps 650 | 651 | - **Generate your first dataset** with our [Quick start](/quick-start) guide 652 | - **Explore advanced features** in our [Features](/features) section 653 | - **Learn best practices** for optimal performance 654 | - **Check out our [API Reference](/features/api)** for complete documentation 655 | --------------------------------------------------------------------------------