Skip to content

Instantly share code, notes, and snippets.

View lkdocs's full-sized avatar

LaunchKey Documentation Examples lkdocs

View GitHub Profile
@lkdocs
lkdocs / LaunchKey PHP SDK - Handle Callback.php
Last active August 29, 2015 14:18
LaunchKey PHP SDK - Handle Callback
$response = $client->auth()->handleCallback($_GET);
@lkdocs
lkdocs / LaunchKey PHP SDK - User Authorization.php
Created March 31, 2015 21:19
LaunchKey PHP SDK - Check Status
$authResponse = $client->auth()->getStatus("AuthRequestID");
@lkdocs
lkdocs / LaunchKey PHP SDK - User Authorization.php
Last active August 29, 2015 14:18
LaunchKey PHP SDK - User Authorization
$authRequest = $launchkey->auth()->authorize("LaunchKeyUserName");
@lkdocs
lkdocs / LaunchKey PHP SDK - User Authentication.php
Created March 31, 2015 21:02
LaunchKey PHP SDK - User Authentication
$authRequest = $client->auth()->authenticate("LaunchKeyUserName");
@lkdocs
lkdocs / LaunchKey PHP SDK - Create Client From Factory - Config.php
Created March 31, 2015 17:15
LaunchKey PHP SDK - Create Client From Factory - Config
$config = new \LaunchKey\SDK\Config();
$config->setAppKey("1234567890")
->setSecretKey("supersecretandwayrandomsecretkey")
->setPrivateKeyLocation("/usr/local/etc/launchkey-app-private-key.pem");
$client = \LaunchKey\SDK\Client::factory($config);
@lkdocs
lkdocs / LaunchKey PHP SDK - Create Client From Factory - Simple.php
Last active August 29, 2015 14:18
LaunchKey PHP SDK - Create Client From Factory - Simple
$client = \LaunchKey\SDK\Client::factory(
"1234567890",
"supersecretandwayrandomsecretkey",
file_get_contents("/usr/local/etc/launchkey-app-private-key.pem")
);
@lkdocs
lkdocs / LaunchKey Node.js SDK - Create White Label User.js
Created March 31, 2015 00:16
LaunchKey Node.js SDK - Create White Label User
launchKey.createWhiteLabelUser(
identifier,
function (whiteLabelUser) {
cli.ok("User with identifier of \"" + identifier + "\" created with:");
cli.ok(" QR Code URL: " + whiteLabelUser.getQrCodeUrl());
cli.ok(" Code: " + whiteLabelUser.getCode());
},
error
);
@lkdocs
lkdocs / LaunchKey Node.js SDK - DeOrbit.js
Created March 30, 2015 23:47
LaunchKey Node.js SDK - DeOrbit
var AuthRequest = require("launchkey-sdk").AuthRequest,
authRequest = new AuthRequest("auth request ID")
error = function (error) {
console.error("Error encountered: [" + error.code + "] " + error.message);
};
launchKey.deorbit(
authRequest,
function () {
console.log("Logged out " + authRequest.getId());
@lkdocs
lkdocs / LaunchKey Node.js SDK - Is Authorized.js
Created March 30, 2015 23:41
LaunchKey Node.js SDK - Is Authorized
var AuthRequest = require("launchkey-sdk").AuthRequest,
authRequest = new AuthRequest("auth request ID")
error = function (error) {
console.error("Error encountered: [" + error.code + "] " + error.message);
};
launchKey.isAuthorized(
authRequest,
function () {
console.log("Request is still authorized");
@lkdocs
lkdocs / LaunchKey Node.js SDK - Check Status.js
Last active August 29, 2015 14:18
LaunchKey Node.js SDK - Check Status
var error = function (error) {
console.log("Error encountered: [" + error.code + "] " + error.message);
},
poll = function (authRequest) {
launchKey.checkStatus(
authRequest,
function (authRequest) {
console.log("User accepted launch request " + authRequest.getId());
},
function (authRequest) {