> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ollie.shop/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start

> Build and deploy a powerful data transformation API in 3 minutes. Transform product data, validate inputs, and get a production-ready endpoint instantly.

{/* 
Hub Integration Pattern Keywords: JSONPlaceholder integration, API proxy enhancement, data transformation, Hub URL pattern, real-time API enhancement.

Step-by-Step Process:
1. Access admin.ollie.app for account setup
2. Create organization and project structure  
3. Configure Request Function with trigger pattern
4. Deploy code with automatic build process
5. Activate function to handle live traffic
6. Test Hub integration with enhanced responses

Technical Implementation:
- Hub URL format: https://hub.ollie.app/https://original-api.com/endpoint
- Function export pattern: export const handler = async (event: any)
- Required files: index.ts (with handler export) and package.json
- Build process: dependency installation, TypeScript compilation, deployment
- Function states: deployed (inactive) -> activated (live traffic)

JSONPlaceholder Example Context:
- Original API: https://jsonplaceholder.typicode.com/posts/1
- Hub-enhanced call: https://hub.ollie.app/https://jsonplaceholder.typicode.com/posts/1
- Transformation adds: analytics (word count, reading time), SEO data (slug, meta), social sharing URLs
- Business value: API enhancement without modifying original service

Common Deployment Questions:
- How do I upload my function code?
- What files are required in my project folder?
- How long does the build process take?
- Why do I need to activate my function after deployment?
- How do I test my Hub integration?
- What's the difference between build status and function status?

Related Concepts: function types (request/response/task), trigger patterns, Hub proxy, API transformation, serverless deployment, function activation, real-time monitoring

User Success Metrics: 3-minute deployment time, production-ready endpoint, automatic scaling, global deployment, real-time monitoring
*/}

Build a production-ready data transformation API in under 3 minutes. No infrastructure setup, no complex configuration - just powerful serverless functions that scale automatically.

<CardGroup cols={3}>
  <Card title="3 Minutes" icon="stopwatch">
    From code to live API endpoint
  </Card>

  <Card title="Auto-scaling" icon="chart-line">
    Handles 1 to 10,000+ requests instantly
  </Card>

  <Card title="Production Ready" icon="shield-check">
    HTTPS, monitoring, and global deployment
  </Card>
</CardGroup>

<Warning>
  **Real Business Impact**: This isn't a "hello world" demo. You'll experience the full power of Ollie Hub's integration system - enhancing external APIs with custom business logic and data processing. This is the kind of Hub integration that powers production applications.
</Warning>

## What You'll Build

Experience Ollie Hub's custom integration power. When someone calls JSONPlaceholder through Hub, your function automatically enhances and transforms the response.

**Original JSONPlaceholder API:**

```bash theme={"system"}
curl "https://jsonplaceholder.typicode.com/posts/1"
```

**Returns basic data:**

```json theme={"system"}
{
  "userId": 1,
  "id": 1,
  "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
  "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
}
```

**Hub-Enhanced Call:**

```bash theme={"system"}
curl "https://hub.ollie.app/https://jsonplaceholder.typicode.com/posts/1"
```

**Your Hub integration transforms it to:**

```json theme={"system"}
{
  "id": 1,
  "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
  "content": "quia et suscipit\nsuscipit recusandae...",
  "analytics": {
    "wordCount": 19,
    "readingTimeMinutes": 1,
    "characterCount": 146,
    "estimatedViewTime": "30 seconds"
  },
  "seo": {
    "slug": "sunt-aut-facere-repellat-provident",
    "metaTitle": "sunt aut facere repellat provident - Blog Post",
    "metaDescription": "quia et suscipit suscipit recusandae consequuntur...",
    "canonicalUrl": "https://myblog.com/posts/sunt-aut-facere-repellat-provident"
  },
  "social": {
    "twitterShareUrl": "https://twitter.com/intent/tweet?text=sunt%20aut%20facere...",
    "linkedinShareUrl": "https://linkedin.com/sharing/share-offsite/?url=...",
    "hashtags": ["#blog", "#content", "#reading"]
  },
  "transformedAt": "2024-01-15T10:30:00.000Z"
}
```

## Deploy Your Function

<Steps>
  <Step title="Access Ollie Hub">
    Navigate to **[admin.ollie.app](https://admin.ollie.app)** and sign in with:

    <CardGroup cols={3}>
      <Card title="GitHub" icon="github">
        One-click OAuth for developers
      </Card>

      <Card title="Google" icon="google">
        Enterprise SSO ready
      </Card>

      <Card title="Email" icon="envelope">
        Secure magic link authentication
      </Card>
    </CardGroup>
  </Step>

  <Step title="Create Your Workspace">
    <Tabs>
      <Tab title="Organization Setup">
        **Quick Organization:**

        * Name: `Your Company`

        <Tip>
          **Pro Tip**: Choose a descriptive name - you'll invite team members here later.
        </Tip>
      </Tab>

      <Tab title="Project Creation">
        **Project Details:**

        * Name: `jsonplaceholder-integration`
        * Description: `JSONPlaceholder API Hub integration and transformation`
      </Tab>
    </Tabs>
  </Step>

  <Step title="Create Request Function">
    <Accordion title="Function Configuration">
      **Function Settings:**

      * **Name**: `jsonplaceholder-transformer`
      * **Type**: `Request Function`
      * **Trigger Pattern**: `https://jsonplaceholder.typicode.com/posts/*`
      * **Memory**: `256 MB`
      * **Timeout**: `30 seconds`
      * **Runtime**: `Node.js 18.x`

      <Info>
        **Hub Integration**: Your function will automatically enhance any calls to JSONPlaceholder posts and transform the response. When someone calls `https://hub.ollie.app/https://jsonplaceholder.typicode.com/posts/1`, your Hub integration processes it.
      </Info>
    </Accordion>

    **Paste this production-ready code:**

    **Complete function file:**

    <CodeGroup>
      ```typescript index.ts theme={"system"}
      // TypeScript interfaces
      interface Post {
        userId: number;
        id: number;
        title: string;
        body: string;
      }

      interface EnrichedPost extends Post {
        content: string;
        analytics: {
          wordCount: number;
          readingTimeMinutes: number;
          characterCount: number;
          estimatedViewTime: string;
        };
        seo: {
          slug: string;
          metaTitle: string;
          metaDescription: string;
          canonicalUrl: string;
        };
        social: {
          twitterShareUrl: string;
          linkedinShareUrl: string;
          hashtags: string[];
        };
        transformedAt: string;
      }

      // Main Hub integration handler
      export const handler = async (event: any): Promise<any> => {
        try {
          // First, fetch the original JSONPlaceholder data
          const originalResponse = await fetch(event.url);
          
          if (!originalResponse.ok) {
            return {
              statusCode: originalResponse.status,
              body: 'Post not found'
            };
          }
          
          const originalPost: Post = await originalResponse.json();
          
          // Transform the data with analytics and enrichment
          const enrichedPost = enrichPostData(originalPost);
          
          return {
            statusCode: 200,
            headers: {
              'Content-Type': 'application/json',
              'Access-Control-Allow-Origin': '*',
              'Cache-Control': 'public, max-age=300'
            },
            body: JSON.stringify(enrichedPost)
          };
          
        } catch (error) {
          console.error('Post transformation error:', error);
          return {
            statusCode: 500,
            headers: { 'Content-Type': 'application/json' },
            body: JSON.stringify({
              error: 'Internal server error',
              timestamp: new Date().toISOString()
            })
          };
        }
      };

      // Data transformation function
      function enrichPostData(post: Post): EnrichedPost {
        const now = new Date().toISOString();
        
        // Generate slug from title
        const slug = post.title.toLowerCase()
          .replace(/[^a-z0-9\s]/g, '')
          .trim()
          .replace(/\s+/g, '-')
          .substring(0, 50);
        
        // Calculate content analytics
        const wordCount = post.body.split(/\s+/).length;
        const readingTimeMinutes = Math.max(1, Math.round(wordCount / 200));
        const characterCount = post.body.length;
        
        // Generate meta description (first 155 chars)
        const metaDescription = post.body.substring(0, 155) + '...';
        
        // Create share URLs
        const encodedTitle = encodeURIComponent(post.title);
        const encodedUrl = encodeURIComponent(`https://myblog.com/posts/${slug}`);
        
        return {
          ...post,
          content: post.body,
          analytics: {
            wordCount,
            readingTimeMinutes,
            characterCount,
            estimatedViewTime: readingTimeMinutes < 2 ? '30 seconds' : `${readingTimeMinutes} minutes`
          },
          seo: {
            slug,
            metaTitle: `${post.title} - Blog Post`,
            metaDescription,
            canonicalUrl: `https://myblog.com/posts/${slug}`
          },
          social: {
            twitterShareUrl: `https://twitter.com/intent/tweet?text=${encodedTitle}&url=${encodedUrl}`,
            linkedinShareUrl: `https://linkedin.com/sharing/share-offsite/?url=${encodedUrl}`,
            hashtags: ['#blog', '#content', '#reading']
          },
          transformedAt: now
        };
      }
      ```

      ```json package.json theme={"system"}
      {
        "name": "jsonplaceholder-integration",
        "version": "1.0.0",
        "description": "JSONPlaceholder API Hub integration and transformation",
        "main": "index.ts",
        "scripts": {
          "build": "tsc",
          "test": "npm run build"
        },
        "dependencies": {},
        "devDependencies": {
          "typescript": "^5.0.0",
          "@types/node": "^20.0.0"
        },
        "keywords": [
          "ollie-hub",
          "api-integration",
          "data-transformation"
        ],
        "author": "Your Name",
        "license": "MIT"
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Deploy & Build">
    <Accordion title="Deployment Process">
      **Click "Deploy Function"** to trigger the build process:

      1. **Code Upload**: Your function code is securely uploaded
      2. **Build Process**: Dependencies installed and optimized
      3. **Deployment**: Function deployed to global infrastructure
      4. **Ready for Activation**: Function is built and ready to activate

      <Note>
        **Build Time**: First deployment takes 30-60 seconds. Subsequent deploys are faster with caching.
      </Note>
    </Accordion>

    **Watch real-time build logs** in the deployment panel:

    ```bash theme={"system"}
    ✓ Code validation passed
    ✓ Dependencies installed
    ✓ Function packaged
    ✓ Function deployed successfully
    ✓ Ready for activation
    ```
  </Step>

  <Step title="Activate Function">
    **Make your function live and ready for requests**

    After successful deployment, your function will show as **INACTIVE**. Click **"Activate Function"** to make it live.

    <Warning>
      **Activation Required**: Functions are deployed but inactive by default. You must activate them to start receiving traffic.
    </Warning>

    ```bash theme={"system"}
    ✓ Function activated successfully
    ✓ Hub integration live: https://hub.ollie.app/https://jsonplaceholder.typicode.com/posts/*
    ```
  </Step>

  <Step title="Test Hub Integration">
    After activating your function, your Hub integration is now enhancing JSONPlaceholder calls! When you call the original API through Hub, your transformation runs automatically:

    <CodeGroup>
      ```bash cURL Test theme={"system"}
      curl "https://hub.ollie.app/https://jsonplaceholder.typicode.com/posts/1"
      ```

      ```typescript Fetch API theme={"system"}
      const response = await fetch('https://hub.ollie.app/https://jsonplaceholder.typicode.com/posts/1');
      const enrichedPost = await response.json();
      console.log(enrichedPost);
      ```

      ```python Python Requests theme={"system"}
      import requests

      response = requests.get('https://hub.ollie.app/https://jsonplaceholder.typicode.com/posts/1')
      enriched_post = response.json()
      print(enriched_post)
      ```
    </CodeGroup>

    <Note>
      **Hub Integration Magic**: Notice you're calling the exact same JSONPlaceholder URL, but through `hub.ollie.app`. Your integration automatically enhances and transforms the response without the caller knowing!
    </Note>

    **Transformed Response:**

    ```json theme={"system"}
    {
      "userId": 1,
      "id": 1,
      "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
      "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto",
      "content": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto",
      "analytics": {
        "wordCount": 19,
        "readingTimeMinutes": 1,
        "characterCount": 146,
        "estimatedViewTime": "30 seconds"
      },
      "seo": {
        "slug": "sunt-aut-facere-repellat-provident",
        "metaTitle": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit - Blog Post",
        "metaDescription": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem...",
        "canonicalUrl": "https://myblog.com/posts/sunt-aut-facere-repellat-provident"
      },
      "social": {
        "twitterShareUrl": "https://twitter.com/intent/tweet?text=sunt%20aut%20facere...",
        "linkedinShareUrl": "https://linkedin.com/sharing/share-offsite/?url=...",
        "hashtags": ["#blog", "#content", "#reading"]
      },
      "transformedAt": "2024-01-15T10:30:00.000Z"
    }
    ```
  </Step>
</Steps>

## Understanding Hub Integrations

<Accordion title="How Hub Integrations Work">
  The `https://hub.ollie.app/` URL enables powerful API customization and transformation through Hub:

  **Original API Call:**

  ```
  GET https://jsonplaceholder.typicode.com/posts/1
  ```

  **Hub-Enhanced Call:**

  ```
  GET https://hub.ollie.app/https://jsonplaceholder.typicode.com/posts/1
  ```

  **What happens behind the scenes:**

  1. **Pattern Matching**: Hub checks if the URL matches your integration's trigger pattern
  2. **Custom Processing**: Your Hub function receives the original request and fetches the real data
  3. **Transformation**: Your function processes and enriches the response
  4. **Seamless Response**: Caller receives enhanced data, thinking it came from the original API

  **Real-World Use Cases:**

  * **API Enhancement**: Add analytics, caching, or rate limiting to any API
  * **Data Transformation**: Convert between API formats or add computed fields
  * **Legacy Modernization**: Add modern features to old APIs without changing them
  * **Multi-source Aggregation**: Combine data from multiple APIs into one response

  **Benefits:**

  * **Zero Infrastructure**: No servers to manage or scale
  * **Seamless Integration**: Callers don't know transformation is happening
  * **Global Performance**: Automatic edge caching and routing
  * **Built-in Monitoring**: Request logs, error tracking, performance metrics
  * **Security**: HTTPS by default, input validation, DDoS protection
</Accordion>

## Function Types & Triggers

<CardGroup cols={1}>
  <Card title="Request Functions" icon="bolt">
    **Perfect for**: APIs, webhooks, real-time processing

    **Trigger**: HTTP requests via Hub proxy

    **Examples**: User authentication, payment processing, data validation

    **Response**: Immediate HTTP response to caller
  </Card>

  <Card title="Response Functions" icon="arrow-right">
    **Perfect for**: Post-processing, notifications, cleanup tasks

    **Trigger**: Automatically after Request Functions complete

    **Examples**: Send confirmation emails, update analytics, cache invalidation

    **Response**: Runs asynchronously, no direct response to original caller
  </Card>

  <Card title="Task Functions" icon="clock">
    **Perfect for**: Scheduled jobs, maintenance, reports

    **Trigger**: Cron expressions (e.g., daily at 9 AM)

    **Examples**: Daily reports, data cleanup, inventory sync

    **Response**: Runs on schedule, logs available in dashboard
  </Card>
</CardGroup>

## Production Features

Your function is immediately production-ready with:

<CardGroup cols={2}>
  <Card title="Auto-scaling" icon="chart-line">
    Handles 1 to 10,000+ concurrent requests automatically
  </Card>

  <Card title="Global Deployment" icon="globe">
    Available worldwide through edge locations
  </Card>

  <Card title="Real-time Monitoring" icon="chart-line">
    Live request logs, error tracking, and performance metrics
  </Card>

  <Card title="Built-in Security" icon="shield">
    HTTPS by default, input validation, and DDoS protection
  </Card>
</CardGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Add Response Functions" icon="arrow-right" href="/ollie-hub/core-concepts/response-functions">
    Trigger actions after Hub integrations
  </Card>

  <Card title="Schedule Tasks" icon="clock" href="/ollie-hub/core-concepts/task-functions">
    Automate periodic API data processing
  </Card>

  <Card title="Team Collaboration" icon="users" href="/ollie-hub/core-concepts/team-management">
    Invite developers and set permissions
  </Card>

  <Card title="Production Deployment" icon="rocket" href="/ollie-hub/development/deployment">
    Deploy to staging and production environments
  </Card>
</CardGroup>

***

<Note>
  **Congratulations!** You've deployed a production-ready API that can handle thousands of requests. Your function is automatically scaling, monitored, and ready to power real applications. View detailed logs and metrics in your [Ollie Hub dashboard](https://admin.ollie.app).
</Note>
