NAME

Chat::Envolve - A Perl API for the Envolve web chat system.

VERSION

version 0.0100

SYNOPSIS

 my $chat = Chat::Envolve->new(
    api_key     => $key,
    client_ip   => $user_ip_address,
 );
 
 my $html = $chat->get_tags('Joe');
 
 my $command = $chat->get_login_command('Joe');

DESCRIPTION

This is a Perl API for the Envolve http://www.envolve.com chat system. If you'd like to see it in use, check out The Lacuna Expanse http://www.lacunaexpanse.com. Currently Envolve has not exposed much functionality, but using this API will allow you to have your users automatically logged in/out of the chat based upon their web site logins.

METHODS

new ( api_key => '111-xxx', client_ip => '127.0.0.1' )

Constructor. Requires both params.

api_key

The API key provided by Envolve.

client_ip

The IP address of the user. Usually REMOTE_ADDR in HTTP environment variables. Can also be set to none to disable IP security checking.

get_login_command ( first_name , [ options ] )

Returns a signed login command string that can be used to log a user into a chat by calling some javascript.

 <script type="text/javascript">
    env_executeCommand(command_string_goes_here);
 </script>

If you prefer you can just inline it into the web page using the get_tags method.

first_name

A string, either the first name of the user, or their alias.

options

A hash of optional parameters.

last_name

A string, the last name of the user.

picture_url

A url of a picture or avatar for the user.

is_admin

If set to 1, the user will gain admin privileges, which currently means that if enabled in the Envolve settings they'll be able to create and close chats administratively.

get_logout_command ( )

Returns a signed logout command string that can be used to log a user out of a chat by calling some javascript.

 <script type="text/javascript">
    env_executeCommand(command_string_goes_here);
 </script>

If you prefer you can just inline it into the web page using the get_tags method and pass no params to it.

get_tags ( [ first_name, options ] )

Returns some HTML tags that can be inlined into your web page to start the chat. If no parameters are passed in, then the user will be anonymous. If first_name is passed in then the user will be authenticated.

first_name

See get_login_command

options

See get_login_command

client_ip ( ip_address )

Normally you wouldn't ever need to use this command, but if you wanted to use the same Chat::Envolve object to log in more than one user then you could set the IP for each user by using this command.

ip_address

An IP address.

EXCEPTIONS

Currently this module doesn't throw any exceptions.

TODO

Nothing is planned until Envolve releases more functionality.

PREREQS

Moose DateTime MIME::Base64 Digest::SHA Encode

SUPPORT

Repository

http://github.com/rizen/Chat-Envolve

Bug Reports

http://github.com/rizen/Chat-Envolve/issues

SEE ALSO

If you want to see this module in use, check out The Lacuna Expanse http://www.lacunaexpanse.com. If you want to learn more about Envolve visit their web site http://www.envolve.com.

AUTHOR

JT Smith <jt_at_plainblack_dot_com>

LEGAL

Chat::Envolve is Copyright 2010 Plain Black Corporation (http://www.plainblack.com) and is licensed under the same terms as Perl itself. Envolve and its copyrights and trademarks are the property of Envolve, Inc.