Download the PHP package stytch/stytch-php without Composer

On this page you can find all versions of the php package stytch/stytch-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package stytch-php

Stytch PHP SDK

The Stytch PHP SDK makes it simple to integrate Stytch into your PHP application.

Installation

Install the SDK using Composer:

Usage

Consumer (B2C) Client

B2B Client

Environment

The SDK supports both test and live environments:

If no environment is specified, the SDK will auto-detect based on your project ID.

Async API Support

All SDK methods have async counterparts that return Guzzle Promises, allowing for non-blocking operations and concurrent requests.

Basic Async Usage

Concurrent Requests

Advanced Promise Usage

Error Handling

The SDK throws StytchException for API errors:

Async Error Handling

Async methods handle errors through promise rejection:

Requirements

Upgrading to 2.0

PHP 8.4 Compatibility

Version 2.0 adds full support for PHP 8.4 by using explicit nullable type declarations. If you're using PHP 8.4 with strict deprecation handling (common in PHPUnit/Laravel test environments), you must upgrade to v2.0+ to avoid deprecation errors.

Fixed in v2.0:

Breaking Changes

WhatsApp OTP Namespace Change

The WhatsApp OTP class has been renamed to fix capitalization:

Impact: Only affects code that directly imports or type-hints the OTPsWhatsapp class. The property access $client->otps->whatsapp remains unchanged.

New Features in 2.0

Testing

The SDK includes a comprehensive test suite covering both Consumer and B2B functionality.

Setup Tests

  1. Set up environment variables:

  2. Install test dependencies:

Running Tests

Test Coverage

The test suite covers:

Consumer API:

B2B API:

Async Functionality:

See tests/README.md for detailed testing documentation.

Development

Project Structure

Code Quality

This project uses:

Run code quality checks:

Contributing

Please see our contribution guidelines for details on how to contribute to this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.


All versions of stytch-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
guzzlehttp/guzzle Version ^7.0
firebase/php-jwt Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stytch/stytch-php contains the following files

Loading the files please wait ...