PHPackages                             fleetbase/samsara-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. fleetbase/samsara-api

ActiveLibrary[API Development](/categories/api)

fleetbase/samsara-api
=====================

Vehicle Data Import &amp; Location Integration via Samsara API

0.0.3(5mo ago)0501AGPL-3.0-or-laterPHPPHP ^8.0CI passing

Since Aug 27Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/fleetbase/samsara)[ Packagist](https://packagist.org/packages/fleetbase/samsara-api)[ RSS](/packages/fleetbase-samsara-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (4)Used By (0)

 [![](https://private-user-images.githubusercontent.com/816371/479796410-5c9bf4c6-64ac-40f5-ada8-4ec48ec9ca1e.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU0NTI2NjUsIm5iZiI6MTc3NTQ1MjM2NSwicGF0aCI6Ii84MTYzNzEvNDc5Nzk2NDEwLTVjOWJmNGM2LTY0YWMtNDBmNS1hZGE4LTRlYzQ4ZWM5Y2ExZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwNlQwNTEyNDVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00NjE4YTdiN2E3OTBhYjZiZmNkNGIzZjJlNzc5OGU5OGRjNmRmMDY3YmNlODMyYjIzMDYyYTFkM2ZjMGZmZWFmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.oCOmi4Kju1R60HU8hwSvnlgFAx00ZSLro6OizrM6VRE)](https://private-user-images.githubusercontent.com/816371/479796410-5c9bf4c6-64ac-40f5-ada8-4ec48ec9ca1e.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU0NTI2NjUsIm5iZiI6MTc3NTQ1MjM2NSwicGF0aCI6Ii84MTYzNzEvNDc5Nzk2NDEwLTVjOWJmNGM2LTY0YWMtNDBmNS1hZGE4LTRlYzQ4ZWM5Y2ExZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwNlQwNTEyNDVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00NjE4YTdiN2E3OTBhYjZiZmNkNGIzZjJlNzc5OGU5OGRjNmRmMDY3YmNlODMyYjIzMDYyYTFkM2ZjMGZmZWFmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.oCOmi4Kju1R60HU8hwSvnlgFAx00ZSLro6OizrM6VRE)

 A comprehensive Fleetbase extension that integrates with the Samsara API for vehicle data import and real-time location tracking. This extension enables fleet operators to seamlessly sync vehicle data from Samsara into their Fleetbase instance, providing unified fleet management capabilities.

---

Overview
--------

[](#overview)

The Samsara Extension bridges the gap between Samsara's fleet management platform and Fleetbase's comprehensive logistics solution. It provides real-time vehicle data synchronization, location tracking, and event processing capabilities that enhance fleet visibility and operational efficiency.

- PHP 8.2 or above
- Ember.js v5.4 or above
- Ember CLI v5.4 or above
- Node.js v18 or above

### Key Benefits

[](#key-benefits)

- **Unified Fleet Management**: Manage both Samsara and non-Samsara vehicles within a single Fleetbase interface
- **Real-time Location Tracking**: Automatic location updates via Samsara webhooks
- **Comprehensive Vehicle Data**: Import detailed vehicle information including VIN, serial numbers, and metadata
- **Multi-tenant Architecture**: Secure company-level data isolation
- **Role-based Access Control**: Granular permissions for different user roles
- **Scalable Integration**: Handles high-volume webhook events and API calls

Features
--------

[](#features)

### Core Functionality

[](#core-functionality)

- **Vehicle Data Synchronization**: Automated import of vehicle information from Samsara
- **Real-time Location Updates**: Live vehicle tracking via webhook integration
- **Credential Management**: Secure storage and management of Samsara API credentials
- **Event Processing**: Comprehensive webhook event handling and logging
- **Multi-company Support**: Full multi-tenancy with company-level data isolation

### Advanced Features

[](#advanced-features)

- **Scheduled Synchronization**: Configurable sync intervals for vehicle data
- **Error Handling &amp; Retry Logic**: Robust error handling with automatic retry mechanisms
- **Health Monitoring**: Built-in health checks and sync status monitoring
- **Audit Trail**: Complete logging of all sync operations and webhook events
- **Flexible Linking**: Link Samsara vehicles to existing FleetOps vehicles

Structure
---------

[](#structure)

```
├── addon
├── app
├── assets
├── translations
├── config
├── node_modules
├── server
│ ├── config
│ ├── data
│ ├── migrations
│ ├── resources
│ ├── src
│ ├── tests
│ └── vendor
├── tests
├── testem.js
├── index.js
├── package.json
├── phpstan.neon.dist
├── phpunit.xml.dist
├── pnpm-lock.yaml
├── ember-cli-build.js
├── composer.json
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md

```

Installation
------------

[](#installation)

### Backend

[](#backend)

Install the PHP packages using Composer:

```
composer require fleetbase/core-api
composer require fleetbase/samsara-api
```

### Frontend

[](#frontend)

Install the Ember.js Engine/Addon:

```
pnpm install @fleetbase/samsara-engine
```

Configuration
-------------

[](#configuration)

### Environment Variables

[](#environment-variables)

Add the following environment variables to your `.env` file:

```
# Samsara Extension Configuration
SAMSARA_DEFAULT_SYNC_INTERVAL=5
SAMSARA_WEBHOOK_TIMEOUT=30
SAMSARA_API_TIMEOUT=30
SAMSARA_MAX_RETRY_ATTEMPTS=3
```

### Samsara API Credentials

[](#samsara-api-credentials)

The extension requires Samsara API credentials to function. You can configure these through the Fleetbase console:

1. Navigate to **FleetOps &gt; Settings &gt; Samsara**
2. Click **Add Credential**
3. Fill in the required information:
    - **Name**: A descriptive name for the credential set
    - **API Token**: Your Samsara API token
    - **API Base URL**: Usually `https://api.samsara.com` (leave blank for default)
    - **Environment**: Select Sandbox or Production
    - **Sync Interval**: How often to sync vehicle data (1-60 minutes)

### Webhook Configuration

[](#webhook-configuration)

For real-time updates, configure webhooks in your Samsara dashboard:

1. **Webhook URL**: `https://api.fleetbase.io/int/v1/samsara/webhook/{companyId}`
2. **Events**: Select the events you want to receive:
    - Vehicle Location Updates
    - Vehicle Information Changes
    - Alert Events
3. **Secret**: Generate a webhook secret for signature verification

Usage
-----

[](#usage)

### Basic Vehicle Synchronization

[](#basic-vehicle-synchronization)

Once configured, the extension automatically synchronizes vehicle data from Samsara. You can also trigger manual synchronization:

1. Navigate to **FleetOps &gt; Settings &gt; Samsara &gt; Vehicles**
2. Click **Sync All** to import all vehicles
3. Use the **Sync** button next to individual vehicles for selective updates

Permissions &amp; Security
--------------------------

[](#permissions--security)

The extension implements comprehensive role-based access control with the following permission structure:

### Permission Categories

[](#permission-categories)

#### Credential Permissions

[](#credential-permissions)

- `samsara view credentials`: View API credentials
- `samsara create credentials`: Create new credentials
- `samsara update credentials`: Modify existing credentials
- `samsara delete credentials`: Remove credentials
- `samsara test credentials`: Test API connections
- `samsara manage credentials`: Activate/deactivate credentials

#### Vehicle Permissions

[](#vehicle-permissions)

- `samsara view vehicles`: View vehicle data and sync status
- `samsara create vehicles`: Create new vehicle syncs
- `samsara update vehicles`: Modify vehicle sync settings
- `samsara delete vehicles`: Remove vehicle syncs
- `samsara sync vehicles`: Trigger manual synchronization
- `samsara link vehicles`: Link/unlink vehicles to FleetOps
- `samsara view location history`: Access vehicle location history

#### Webhook Permissions

[](#webhook-permissions)

- `samsara view webhook events`: View webhook events and logs
- `samsara manage webhook events`: Retry events and manage settings

#### Administrative Permissions

[](#administrative-permissions)

- `samsara view sync status`: View synchronization status
- `samsara manage sync`: Trigger syncs and manage settings
- `samsara admin`: Full administrative access

### Predefined Roles

[](#predefined-roles)

#### Samsara Viewer

[](#samsara-viewer)

Basic read-only access to view vehicles, credentials, and events.

#### Samsara Operator

[](#samsara-operator)

Operational access including vehicle syncing and linking capabilities.

#### Samsara Manager

[](#samsara-manager)

Management access including credential management and webhook configuration.

#### Samsara Administrator

[](#samsara-administrator)

Full administrative access to all extension features.

Usage
-----

[](#usage-1)

### Backend

[](#backend-1)

🧹 Keep a modern codebase with **PHP CS Fixer**:

```
composer lint
```

⚗️ Run static analysis using **PHPStan**:

```
composer test:types
```

✅ Run unit tests using **PEST**

```
composer test:unit
```

🚀 Run the entire test suite:

```
composer test
```

### Frontend

[](#frontend-1)

🧹 Keep a modern codebase with **ESLint**:

```
pnpm lint
```

✅ Run unit tests using **Ember/QUnit**

```
pnpm test
pnpm test:ember
pnpm test:ember-compatibility
```

🚀 Start the Ember Addon/Engine

```
pnpm start
```

🔨 Build the Ember Addon/Engine

```
pnpm build
```

Contributing
------------

[](#contributing)

See the Contributing Guide for details on how to contribute to this project.

License
-------

[](#license)

This project is licensed under the AGPL-3.0-or-later License. See the [LICENSE](LICENSE.md) file for details.

---

**Developed by Fleetbase**

For support, please contact  or visit our [documentation](https://docs.fleetbase.io).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance71

Regular maintenance activity

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~50 days

Total

3

Last Release

164d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9350b92834554a15fb0fff7c7c73750c86a5edd5038e4f0006f8b888a9379b57?d=identicon)[fleetbase](/maintainers/fleetbase)

---

Top Contributors

[![roncodes](https://avatars.githubusercontent.com/u/816371?v=4)](https://github.com/roncodes "roncodes (14 commits)")

---

Tags

trackingintegrationvehiclefleetfleetbasefleetbase-extensionsamsara

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/fleetbase-samsara-api/health.svg)

```
[![Health](https://phpackages.com/badges/fleetbase-samsara-api/health.svg)](https://phpackages.com/packages/fleetbase-samsara-api)
```

###  Alternatives

[gabrielbull/ups-api

PHP UPS API

4642.4M10](/packages/gabrielbull-ups-api)[irazasyed/laravel-gamp

Send analytics data to Google Analytics from Laravel. A package for GA Measurement Protocol API

3361.6M1](/packages/irazasyed-laravel-gamp)[shippo/shippo-php

A PHP library for connecting with multiple carriers (FedEx, UPS, USPS) using Shippo.

1711.8M2](/packages/shippo-shippo-php)[wordpress/mcp-adapter

Adapter for Abilities API, letting WordPress abilities to be used as MCP tools, resources or prompts

74855.8k1](/packages/wordpress-mcp-adapter)[fleetbase/fleetops-api

Fleet &amp; Transport Management Extension for Fleetbase

1721.6k3](/packages/fleetbase-fleetops-api)[alexwestergaard/php-ga4

PHP Library for Google Analytics 4 with Server Side Tagging

63144.7k1](/packages/alexwestergaard-php-ga4)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
