Class: Onlyfans::Resources::ClientSessions

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyfans/resources/client_sessions.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ClientSessions

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ClientSessions.

Parameters:



36
37
38
# File 'lib/onlyfans/resources/client_sessions.rb', line 36

def initialize(client:)
  @client = client
end

Instance Method Details

#create(display_name:, client_reference_id: nil, proxy_country: nil, request_options: {}) ⇒ Onlyfans::Models::ClientSessionCreateResponse

Create Client Session Token for later use in embedded auth components - eg. via @onlyfansapi/auth npm package.

Parameters:

Returns:

See Also:



22
23
24
25
26
27
28
29
30
31
# File 'lib/onlyfans/resources/client_sessions.rb', line 22

def create(params)
  parsed, options = Onlyfans::ClientSessionCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/client-sessions",
    body: parsed,
    model: Onlyfans::Models::ClientSessionCreateResponse,
    options: options
  )
end