PHP code example of snipedragon / steamlink

1. Go to this page and download the library: Download snipedragon/steamlink library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

snipedragon / steamlink example snippets




$options = array(
    'apiKey' => 'YOUR-API-KEY-HERE', // Steam API KEY
    'domainName' => 'https://your-site.net', // Shown on the Steam Login page to your users.
    'loginRedirect' => 'https://your-site.net/index.php?page=SteamLink&action=Login', // Returns user to this page on login.
    'logoutRedirect' => 'https://your-site.net/index.php?page=SteamLink&action=Logout', // Returns user to this page on logout.
    'startSession' => false //true to start session, false to only validate and return a steam user object.
);

$steamlink = new SnipeDragon\SteamLink($options);

echo "<p>Click on the following button to login and authenticate yourself through Steam:</p>";
echo $steamlink->loginButton("rectangle"); //Can be "rectangle" or "square".