WorkOS PHP SDK

Passwordless
in package

Table of Contents

Properties

$client  : HttpClient

Methods

__construct()  : mixed
createSession()  : array<string|int, mixed>
Create a Passwordless Session.
sendSession()  : void
Send a Passwordless Session via email.

Properties

Methods

createSession()

Create a Passwordless Session.

public createSession(string $email[, string $type = 'MagicLink' ][, string|null $redirectUri = null ][, string|null $state = null ][, int|null $expiresIn = null ]) : array<string|int, mixed>
Parameters
$email : string

The email of the user to authenticate.

$type : string = 'MagicLink'

The type of Passwordless Session ('MagicLink').

$redirectUri : string|null = null

The redirect endpoint for the callback. (Optional)

$state : string|null = null

Arbitrary state to pass through the redirect. (Optional)

$expiresIn : int|null = null

Seconds until expiry (900-86400). (Optional)

Return values
array<string|int, mixed>

The passwordless session data.

sendSession()

Send a Passwordless Session via email.

public sendSession(string $sessionId) : void
Parameters
$sessionId : string

The unique identifier of the Passwordless Session.


        
On this page

Search results