r4nkt
  • Introduction
  • Getting Started
  • Concepts
    • Overview
    • Achievements
    • Actions
    • Activities
    • Badges
    • Criteria
    • Criteria Conditions
    • Criteria Groups
    • Custom Data Reference
    • Games
    • Leaderboards
    • Players
    • Rewards
    • Scores
  • Cookbook
    • Criteria Conditions
    • Achievements
  • API
    • Overview
    • Authentication
    • Achievements
    • Actions
    • Activities
    • Criteria
    • Criteria Groups
    • Leaderboards
    • Players
    • Player Badges
    • Rewards
    • Scores
  • Webhooks
    • Overview
    • Getting Started
    • Events
  • PHP SDK
    • Overview
    • Getting Started
  • Laravel Package
    • Overview
    • Installation
    • Webhooks
Powered by GitBook
On this page

Was this helpful?

  1. PHP SDK

Getting Started

Installation is quite easy. You can simply grab the latest stable version via composer:

composer require r4nkt/r4nkt-php-sdk

The next step is to create an instance of the SDK's R4nkt object. Its constructor takes the following parameters:

  • string $apiToken (required) Your API token. If you don't have an API key yet, read up on the API authentication first first.

  • string $gameId (required) Your game ID.

  • GuzzleHttp\Client $client (optional) You can pass in your own client to use or allow the SDK to create and use its own.

Here is an example of how one can instantiate the R4nkt object:

$apiToken = 'lR8OsPu9q3VWm70zAA2irbUCWL';
$gameId = 'ABCD1234';

$r4nkt = new R4nkt\PhpSdk\R4nkt($apiToken, $gameId);

Once initiated, you can then begin to manage game resources.

PreviousOverviewNextOverview

Last updated 4 years ago

Was this helpful?