Skip to content

getProject

The getProject function retrieves information about a specific project.

This function is useful for getting details about a particular project, such as its name, supported languages, and defined models.

Example:

import { createClient } from '@content-island/api-client';
const client = createClient({
accessToken: 'YOUR_ACCESS_TOKEN', // This token identifies the project
});
const project = await client.getProject();
console.log(project);
/*
{
id: '1',
name: 'MyProject',
languages: ['es', 'en'],
contentTypes: [
{
id: '100',
name: 'post',
},
],
}
*/

Interface

The getProject function does not accept any parameters. It returns a promise that resolves with an object containing project information.

export interface ApiClient {
getProject: () => Promise<Project>;
// ... other methods
}

Output

The getProject function returns an object containing information about the project. This object has the following structure:

interface Project {
id: string;
name: string;
languages: string[];
contentTypes: { id: string; name: string }[];
}