An example PHP app demonstrating Magic Link with the WorkOS PHP SDK.
Composer - Link
-
Clone the repo and install the dependencies by running the following:
git clone [email protected]:workos/php-example-applications cd php-example-applications/php-magic-link-example composer i
-
Follow the instructions here on setting up Magic Link.
-
Create a new file called
.envand enter your API Key and Client ID from the WorkOS Dashboard.
WORKOS_API_KEY="your_api_key"
WORKOS_CLIENT_ID="your_client_id"
Use the following command to run the app:
php -S localhost:8000 router.phpOnce running, you'll be prompted for an email address, simply plug this in and you'll be sent a magiclink that will redirect you to a success page.