---
title: "TriggerClient: Overview"
sidebarTitle: "Overview"
description: "TriggerClient is used to create a client that connects to the Trigger.dev platform"
---

A [TriggerClient](/documentation/concepts/client-adaptors) is used to connect to a specific [Project](/documentation/concepts/projects) by using an [API Key](/documentation/concepts/environments-apikeys).

```ts Example
export const client = new TriggerClient({
  id: "my-webapp",
  apiKey: process.env.TRIGGER_API_KEY!,
});
```

<Warning>
  The `TriggerClient` should only ever be used in a server-side environment. It is not safe to use
  in a browser environment because it exposes your API Key.
</Warning>

## Constructor

### [TriggerClient()](/sdk/triggerclient/constructor)

Creates a new TriggerClient object.

## Instance properties

<ResponseField name="id" type="string">
  Is used to uniquely identify the client.
</ResponseField>

## Instance methods

#### [sendEvent()](/sdk/triggerclient/instancemethods/sendevent)

Sending an event triggers any Jobs that are listening for that event (based on the name). Use [eventTrigger()](/sdk/eventtrigger) on a Job to listen for events.

You can call this function from anywhere in your code to send an event. The other way to send an event is by using [io.sendEvent()](/sdk/io) from inside a `run()` function.

#### [getEvent()](/sdk/triggerclient/instancemethods/getevent)

The `getEvent()` method gets the event details for a given eventId.

#### [cancelEvent()](/sdk/triggerclient/instancemethods/cancel-event)

The `cancelEvent()` method cancels an event that is scheduled to be delivered in the future.

#### [getRuns()](/sdk/triggerclient/instancemethods/getruns)

The `getRuns()` method gets runs for a Job.

#### [getRun()](/sdk/triggerclient/instancemethods/getrun)

The `getRun()` method gets the details for a given Run.

#### [defineJob()](/sdk/triggerclient/instancemethods/define-job)

The `defineJob()` method defines a new Job.

#### [defineDynamicTrigger()](/sdk/triggerclient/instancemethods/define-dynamic-trigger)

The `defineDynamicTrigger()` method defines a new Dynamic Trigger.

#### [defineDynamicSchedule()](/sdk/triggerclient/instancemethods/define-dynamic-schedule)

The `defineDynamicSchedule()` method defines a new Dynamic Schedule.

#### [defineAuthResolver()](/sdk/triggerclient/instancemethods/define-auth-resolver)

The `defineAuthResolver()` method defines a new Auth Resolver.
