People - Gio85/swapi-ts-sdk GitHub Wiki

In order to fetch the data, the following methods can be used;

  • getSchema() which will return the resource schema
  • read() which will return the single resource
  • list() which will return the resources list
  • getWookiee() which will return.. Wookiee!!

Examples:

  // Get the instance of the client
  const client = ApiClient.getInstance()

  const people = await client.people.list({ search: 'Luke' })
  const people = await client.people.list({ page: 3 })
  const peopleSchema = await client.people.getSchema()
  const singlePerson = await client.people.read('1')
  const lukeWookie = await client.people.getWookiee('1')