1.0.1 • Published 8 months ago

@screenapp/client v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

ScreenApp SDK Client

A JavaScript/TypeScript client for interacting with the ScreenApp API. ScreenApp is an AI Agent Platform that allows your to collect, store and analyze video and audio data. You can record video and audio from your browser or mobile app. Our universal Meeting Bot API allows allows you to join and record meetings on Google Meet and Microsoft Teams. Our AI agent then transcribes, runs pre configured workflows and allows you to query the data in natural language.

Installation

npm install @screenapp/client axios

Usage

Initialization

import ScreenAppClient from '@screenapp/client';

const sdk = new ScreenAppClient({
  token: 'your-auth-token', // Required
  baseUrl: 'https://api.screenapp.io', // Optional, defaults to https://api.screenapp.io
});

API Structure

The SDK is organized into logical API groups. The public SDK exposes the following APIs:

  • files - File system operations (files, folders, etc.)
  • templates - Template operations

Each API group contains methods related to that specific domain.

// Access files API methods
sdk.files.getFiles({ teamId: 'team-id' });

// Access templates API methods
sdk.templates.getTemplates({ teamId: 'team-id' });

File System Operations

// Get files with optional filters
const response = await sdk.files.getFiles({
  teamId: 'team-id',
  folderId: 'folder-id',
  sortBy: 'createdAt',
  sortOrder: 'desc',
  page: 1,
  limit: 20,
  searchQuery: 'search term',
});

const files = response.data.data.files;

// Create a new folder
const folderResponse = await sdk.files.createFolder({
  teamId: 'team-id',
  name: 'New Folder',
});

const folder = folderResponse.data.data.folder;

Template Operations

// Get templates
const response = await sdk.templates.getTemplates({
  teamId: 'team-id',
  page: 1,
  limit: 20,
});

const templates = response.data.data.templates;

// Get a specific template
const templateResponse = await sdk.templates.getTemplate('template-id');
const template = templateResponse.data.data.template;

Error Handling

The SDK uses an HTTP client for requests. Errors can be caught using try/catch:

try {
  const response = await sdk.files.getFiles({ teamId: 'team-id' });
  // Handle successful response
} catch (error) {
  if (error.response) {
    // The request was made and the server responded with a status code
    // that falls out of the range of 2xx
    console.error('Error data:', error.response.data);
    console.error('Error status:', error.response.status);
  } else if (error.request) {
    // The request was made but no response was received
    console.error('No response received:', error.request);
  } else {
    // Something happened in setting up the request that triggered an Error
    console.error('Error message:', error.message);
  }
}

TypeScript Types

The SDK includes TypeScript definitions for all methods and responses.

Project Structure

sdk/
├── api/                  # API classes
│   ├── files.ts          # FilesAPI class
│   ├── templates.ts      # TemplatesAPI class
│   └── index.ts          # API exports
├── types.ts              # TypeScript type definitions
└── index.ts              # Public SDK entry point

License

Copyright © ScreenApp. All rights reserved.

1.0.1

8 months ago

1.0.0

8 months ago