<iframe src="https://developers.devsite.google/frame/maps/documentation/javascript/reference/journey-sharing-authentication_e0ccf7cbb12afa5ad114bd994b04f58a75a3b35f3b67f44867f3101831ad9a8c.frame" class="framebox inherit-locale redirect-iframe" allow="clipboard-write https://developers.devsite.google" allowfullscreen is-upgraded></iframe>

## [AuthToken](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-authentication.md.txt#AuthToken)
interface


interface
`google.maps.journeySharing.AuthToken`

The auth token returned by the token fetcher.

| ### Properties ||
|---|---|
| `expiresInSeconds` | **Type:** `number` The expiration time in seconds. A token expires in this amount of time after fetching. |
| `token` | **Type:** `string` The token. |

## [AuthTokenContext](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-authentication.md.txt#AuthTokenContext)
interface


interface
`google.maps.journeySharing.AuthTokenContext`

Contains additional information needed to mint JSON Web Tokens.

| ### Properties ||
|---|---|
| `deliveryVehicleId` optional | **Type:** `string optional` When provided, the minted token should have a private `DeliveryVehicleId` claim for the provided deliveryVehicleId. |
| `taskId` optional | **Type:** `string optional` When provided, the minted token should have a private `TaskId` claim for the provided taskId. |
| `trackingId` optional | **Type:** `string optional` When provided, the minted token should have a private `TrackingId` claim for the provided trackingId. |
| `tripId` optional | **Type:** `string optional` When provided, the minted token should have a private `TripId` claim for the provided tripId. |
| `vehicleId` optional | **Type:** `string optional` When provided, the minted token should have a private `VehicleId` claim for the provided vehicleId. |

## [AuthTokenFetcher](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-authentication.md.txt#AuthTokenFetcher)
typedef


typedef
`google.maps.journeySharing.AuthTokenFetcher`

Auth token function type.   

A function that accepts a `AuthTokenFetcherOptions` object, containing details about the auth token to be minted. This function should mint the token and return a `AuthToken` containing the token and its expiry time.

`function(AuthTokenFetcherOptions): Promise<AuthToken>`

## [AuthTokenFetcherOptions](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-authentication.md.txt#AuthTokenFetcherOptions)
interface


interface
`google.maps.journeySharing.AuthTokenFetcherOptions`

Options for the auth token fetcher.

| ### Properties ||
|---|---|
| `context` | **Type:** `AuthTokenContext` The auth token context. IDs specified in the context should be added to the request sent to the JSON Web Token minting endpoint. |
| `serviceType` | **Type:** `FleetEngineServiceType` The Fleet Engine service type. |

## [FleetEngineServiceType](https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-authentication.md.txt#FleetEngineServiceType)
constants


constants
`google.maps.journeySharing.FleetEngineServiceType`

library `"journeySharing"`

Types of Fleet Engine services.

These constants are also usable as strings. In TypeScript, the string literals are defined by the `FleetEngineServiceTypeString` type.

```javascript
const {FleetEngineServiceType} = await google.maps.importLibrary("journeySharing");
```

| ### Constants ||
|---|---|
| `DELIVERY_VEHICLE_SERVICE` | Fleet Engine service used to access delivery vehicles. |
| `TASK_SERVICE` | Fleet Engine service used to access task information. |
| `TRIP_SERVICE` | Fleet Engine service used to access trip information. |
| `UNKNOWN_SERVICE` | Unknown Fleet Engine service. |