Getting Started with CrunchzApp SDK

This guide will walk you through the process of installing and configuring the CrunchzApp PHP SDK for your Laravel application.

Requirements

Before you begin, ensure your environment meets the following requirements:

These requirements are essential for the proper functioning of the CrunchzApp SDK.

  • PHP 7.3 or higher - The SDK requires PHP 7.3+ for optimal performance and security
  • Composer - For package management and dependency resolution
  • CrunchzApp account - You’ll need either a Channel Token or Global Token (available in your account)

Not sure which token to use? Global tokens provide access to all channels, while Channel tokens are specific to individual channels. Choose based on your application’s needs.

Installation

Follow these steps to install the SDK in your Laravel project:

Step 1: Install via Composer

Run the following command in your project directory:

composer require crunchzapp/crunchzapp-php-sdk

After installation, you should see the package listed in your composer.json file.

Configuration

Setting up the SDK requires two main steps:

Step 1: Publish Configuration Files

Before initializing the package, publish the configuration file by running:

php artisan vendor:publish --tag=crunchzapp-config

This step is required to make the SDK work properly with your Laravel application.

Step 2: Configure Environment Variables

Add your CrunchzApp token to your .env file:

CRUNCHZAPP_TOKEN=your_token_here

For security reasons, never commit your token to version control. Always use environment variables.

Next Steps

After completing the installation and configuration, you’re ready to start using the CrunchzApp SDK in your Laravel application. Check out our API documentation for available methods and features.