package CatalystX::FacebookURI;
use Moose::Role;
use URI::http;
requires 'facebook';

our $VERSION = '0.02';

=head1 NAME

CatalystX::FacebookURI - Automatically compose uri_for URIs to be within your Facebook application

=head1 VERSION

Version 0.02


Quick summary of what the module does.

Perhaps a little code snippet.

    package MyApp;
    use Moose;
    BEGIN {
        extends 'Catalyst';

        use Catalyst::Runtime 5.80;
        use Catalyst qw(
        with 'CatalystX::FacebookURI';

        facebook => {
            api_key => 'my_key',
            secret  => 'my_s33krit',
            name    => 'myapp'  # Used as app name in URIs

    my $uri = $c->uri_for('/some/path'); # returns


after prepare_path => sub {
    my $c = shift;
    my $is_ajax = $c->req->param('fb_sig_is_ajax');
    my $is_frame = $c->facebook->canvas->in_frame();
    my $is_canvas = $c->facebook->canvas->in_fb_canvas();

    my $app_name = $c->config->{facebook}{name};

        if $is_ajax or $is_frame or $is_canvas;

=head1 AUTHOR

Michael Nachbaur, C<< <mike at> >>

=head1 BUGS

Please report any bugs or feature requests to C<bug-catalystx-facebookuri at>, or through
the web interface at L<>.  I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.

This project is available via Git at

=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc CatalystX::FacebookURI

You can also look for information at:

=over 4

=item * RT: CPAN's request tracker


=item * AnnoCPAN: Annotated CPAN documentation


=item * CPAN Ratings


=item * Search CPAN




Copyright 2010 Michael Nachbaur.

This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.

See for more information.


1; # End of CatalystX::FacebookURI