WorkReels Embed Routes

This directory contains embeddable widgets that can be displayed in iframes on external websites.

Routes

/embed/[companyId]/projects

Displays a company’s projects in a responsive grid layout.

File: [companyId]/projects.astro

Features:

Usage:

<iframe 
    src="https://workreels.ai/embed/COMPANY_ID/projects"
    width="100%"
    height="600"
    frameborder="0"
    title="WorkReels Projects">
</iframe>

Layout

All embed routes use EmbedLayout.astro which provides:

Components

EmbedProjectsGrid.tsx

Simplified version of CompanyProjectsGrid designed for embeds.

Key differences from CompanyProjectsGrid:

API Dependencies

Embed routes use these API endpoints:

  1. Company Metadata

    GET /company/{companyId}

    Returns: company info (name, logo, etc.)

  2. Projects List

    GET /company/{companyId}/projects?status=in_progress,completed&limit=12&offset=0

    Returns: paginated projects list

Adding New Embed Types

To add a new embed type (e.g., /embed/[companyId]/timeline):

  1. Create new file: [companyId]/timeline.astro
  2. Use EmbedLayout for consistent structure
  3. Create dedicated React component if needed
  4. Follow existing patterns for:

Example structure:

---
import EmbedLayout from "../../../layouts/EmbedLayout.astro";
import YourComponent from "../../../components/YourComponent.tsx";

export const prerender = false;

const companyId = Astro.params.companyId;
// Fetch data, handle errors
---

<EmbedLayout title="..." description="...">
  <main class="p-4">
    {/* Your content */}
  </main>
</EmbedLayout>

Testing

Test locally:

npm run dev

Visit:

Documentation

See root-level documentation:

Security

Performance

Browser Support