Skip to content

Commit 38d8a0d

Browse files
authored
Release v2.0 (#29)
1 parent 7a48d34 commit 38d8a0d

4 files changed

Lines changed: 51 additions & 3 deletions

File tree

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
strategy:
1212
matrix:
13-
php-version: ["8.1", "8.2", "8.3"]
13+
php-version: ["8.1", "8.2", "8.3", "8.4"]
1414

1515
name: "Run tests for PHP ${{ matrix.php-version }}"
1616
steps:

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,55 @@ $client->users->getAsync(['user_id' => 'invalid-id'])
160160
- PHP 8.1 or higher
161161
- Guzzle HTTP client
162162

163+
## Upgrading to 2.0
164+
165+
### PHP 8.4 Compatibility
166+
167+
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.
168+
169+
**Fixed in v2.0:**
170+
171+
```php
172+
// v1.x - Implicit nullable (deprecated in PHP 8.4)
173+
function example(array $data = null) { }
174+
175+
// v2.0+ - Explicit nullable (PHP 8.4 compatible)
176+
function example(?array $data = null) { }
177+
```
178+
179+
### Breaking Changes
180+
181+
#### WhatsApp OTP Namespace Change
182+
183+
The WhatsApp OTP class has been renamed to fix capitalization:
184+
185+
```php
186+
// v1.x
187+
use Stytch\Consumer\Api\OTPsWhatsapp; // Old
188+
$client->otps->whatsapp->send(...); // Still works
189+
190+
// v2.0+
191+
use Stytch\Consumer\Api\OTPsWhatsApp; // New (capital A)
192+
$client->otps->whatsapp->send(...); // Still works
193+
```
194+
195+
**Impact:** Only affects code that directly imports or type-hints the `OTPsWhatsapp` class. The property access `$client->otps->whatsapp` remains unchanged.
196+
197+
### New Features in 2.0
198+
199+
- **Local JWT Authentication**: Authenticate JWTs locally without making an API call
200+
- **RBAC Organization Policies**: Set and retrieve organization-specific RBAC policies
201+
- **External ID Management**: Delete external IDs for users and organization members
202+
- **DFP Email Risk API**: New device fingerprinting email risk endpoint
203+
163204
## Testing
164205

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

167208
### Setup Tests
168209

169210
1. Set up environment variables:
211+
170212
```bash
171213
export STYTCH_PROJECT_ID="your-consumer-project-id"
172214
export STYTCH_PROJECT_SECRET="your-consumer-project-secret"
@@ -175,6 +217,7 @@ export STYTCH_B2B_PROJECT_SECRET="your-b2b-project-secret"
175217
```
176218

177219
2. Install test dependencies:
220+
178221
```bash
179222
composer install
180223
```
@@ -200,17 +243,20 @@ vendor/bin/phpunit --coverage-html coverage-html
200243
The test suite covers:
201244

202245
**Consumer API:**
246+
203247
- Users: create, get, update, delete, search (sync & async)
204248
- Passwords: create, authenticate, strength check, reset operations (sync & async)
205249
- Sessions: authenticate, get, revoke, exchange (sync & async)
206250
- Magic Links: send, authenticate, invite operations (sync & async)
207251

208252
**B2B API:**
253+
209254
- Organizations: create, get, update, delete, search (sync & async)
210255
- Organization Members: create, get, update, delete, search, reactivate (sync & async)
211256
- Passwords: create, authenticate, strength check, reset operations, discovery (sync & async)
212257

213258
**Async Functionality:**
259+
214260
- Core HTTP client async methods (GET, POST, PUT, DELETE)
215261
- Promise chaining and error handling
216262
- Concurrent request processing
@@ -245,12 +291,14 @@ tests/
245291
### Code Quality
246292

247293
This project uses:
294+
248295
- **PHPStan** for static analysis
249296
- **PHPUnit** for testing
250297
- **PSR-4** autoloading
251298
- **PSR-12** coding standards
252299

253300
Run code quality checks:
301+
254302
```bash
255303
vendor/bin/phpstan analyse src tests
256304
vendor/bin/phpunit

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"require": {
99
"php": "^8.1",
1010
"guzzlehttp/guzzle": "^7.0",
11-
"firebase/php-jwt": "^6.0"
11+
"firebase/php-jwt": "^7.0"
1212
},
1313
"require-dev": {
1414
"phpunit/phpunit": "^10.0",

src/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
final class Version
66
{
7-
public const VERSION = '2.0.0-alpha.2';
7+
public const VERSION = '2.0.0';
88
}

0 commit comments

Comments
 (0)