Skip to content

Family Sharing

Alex Corn edited this page Jul 25, 2023 · 2 revisions

v4.17.0 or later is required to use family sharing

This is currently experimental.

Methods and events for family sharing are available directly on a SteamUser instance. For example:

const SteamUser = require('steam-user');

let user = new SteamUser();
user.addAuthorizedBorrowers(...);

Methods

addAuthorizedBorrowers(borrowersSteamID[, callback])

  • borrowersSteamID - An array of SteamID objects or strings which can parse into them
  • callback - Optional. Called when the request completes.
    • err - An Error object on failure or null on success

Adds one or more Steam accounts as authorized borrowers of your library.

removeAuthorizedBorrowers(borrowersSteamID[, callback])

  • borrowersSteamID - An array of SteamID objects or strings which can parse into them
  • callback - Optional. Called when the request completes.
    • err - An Error object on failure or null on success

Removes one or more Steam accounts as authorized borrowers of your library.

getAuthorizedBorrowers([options, ]callback)

  • options - Optional. An object with zero or more of these properties:
    • includeCanceled - Unclear what this does (default false)
    • includePending - Include borrowers who have requested authorization but haven't been approved (default false)
  • callback - Called when the request completes.
    • err - An Error object on failure or null on success
    • response - The response object
      • borrowers - An array of objects with these properties:
        • steamid - A SteamID object for the authorized borrower
        • isPending - Bool
        • isCanceled - Bool
        • timeCreated - A Date object

Retrieves a list of Steam accounts that are authorized to borrow your library.

getAuthorizedSharingDevices([options, ]callback)

  • options - Optional. An object with zero or more of these properties:
    • includeCanceled - Unclear what this does (default false)
  • callback - Called when the request completes.
    • err - An Error object on failure or null on success
    • response - The response object
      • devices - An array of objects with these properties:
        • deviceToken - String
        • deviceName - String
        • isPending - Bool
        • isCanceled - Bool
        • isLimited - Bool
        • lastTimeUsed - A Date object or null if not applicable
        • lastBorrower - A SteamID object or null if not applicable
        • lastAppPlayed - Number. The AppID of the last app played on this device or null if not applicable

Retrieves a list of devices that are authorized to share your library.

authorizeLocalSharingDevice(deviceName[, callback])

  • deviceName - A string containing this device's name
  • callback - Optional. Called when the request completes.
    • err - An Error object on failure or null on success
    • response - The response object
      • deviceToken - The newly-authorize device's sharing device token

Authorizes the local device for family sharing. How "local device" is defined is presently unknown, and should be explored.

deauthorizeSharingDevice(deviceToken[, callback])

  • deviceToken - Either a string containing the device token of the device you want to deauthorize, or an object containing a deviceToken property
  • callback - Optional. Called when the request completes.
    • err - An Error object on failure or null on success

Deauthorizes a device for family sharing.

activateSharingAuthorization(ownerSteamID, deviceToken)

  • ownerSteamID - Either a SteamID object or a string which can parse into one
  • deviceToken - String containing the device token you want to activate

Activates a sharing authorization on the local machine. If this succeeds, the licenses event will be emitted containing both your directly-owned licenses and the licenses you have received from this family sharing authorization. Licenses obtained from sharing will have their owner_id property equal to the SteamID accountid of the account which owns the license.

deactivateSharingAuthorization()

Deactivates all sharing authorizations that have been activated using activateSharingAuthorization(). After calling this method, if any shared licenses were previously available, the licenses event will be emitted without those shared licenses.