Class SpaceService

Handles interacting with resources related to spaces.

Hierarchy (View Summary)

Constructors

Properties

Methods

Constructors

Properties

config: RettiwtConfig

The config object.

Methods

  • Get the details of a space.

    Parameters

    • id: string

      The ID of the target space.

    • Optionaloptions: ISpaceDetailsOptions

      Additional options for the fetch.

    Returns Promise<undefined | Space>

    The details of the space with the given ID.

    import { Rettiwt } from 'rettiwt-api';

    const rettiwt = new Rettiwt({ apiKey: API_KEY });

    rettiwt.space.details('1YqJDNEzvoVKV', { withListeners: true })
    .then(res => {
    console.log(res);
    })
    .catch(err => {
    console.log(err);
    });
  • Makes an HTTP request according to the given parameters.

    Type Parameters

    • T = unknown

      The type of the returned response data.

    Parameters

    Returns Promise<AxiosResponse<T, any, {}>>

    The raw Axios response.

    import { FetcherService, ResourceType } from 'rettiwt-api';

    // Creating a new FetcherService instance using the given 'API_KEY'
    const fetcher = new FetcherService({ apiKey: API_KEY });

    // Fetching the details of the User with username 'user1'
    fetcher.request(ResourceType.USER_DETAILS_BY_USERNAME, { id: 'user1' })
    .then(res => {
    console.log(res);
    })
    .catch(err => {
    console.log(err);
    });