Class: Userplex::Resources::Users

Inherits:
Object
  • Object
show all
Defined in:
lib/userplex/resources/users.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Users

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 Users.

Parameters:



38
39
40
# File 'lib/userplex/resources/users.rb', line 38

def initialize(client:)
  @client = client
end

Instance Method Details

#identify(user_id:, email: nil, name: nil, properties: nil, request_options: {}) ⇒ Userplex::Models::UserIdentifyResponse

Creates or updates an end user in InstantDB with the provided information. Requires a valid API key for authentication.

Parameters:

  • user_id (String)

    Unique identifier for the user

  • email (String)

    User email address

  • name (String)

    User full name

  • properties (Hash{Symbol=>Object, nil})

    Additional user properties

  • request_options (Userplex::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



24
25
26
27
28
29
30
31
32
33
# File 'lib/userplex/resources/users.rb', line 24

def identify(params)
  parsed, options = Userplex::UserIdentifyParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/identify",
    body: parsed,
    model: Userplex::Models::UserIdentifyResponse,
    options: options
  )
end