Skip to content

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ClockkIntegrationPlug

Essential starting point when using Phoenix Framework to build a Clockk integration.

Installation

If available in Hex, the package can be installed by adding clockk_integration_plug to your list of dependencies in mix.exs:

defdepsdo[{:clockk_integration_plug,"~> 0.1.0"}]end

If not available in Hex, use:

defdepsdo[{:clockk_integration_plug,git: "https://github.com/liquidmedia/clockk_integration_plug"}]end

add the following to your config.exs file:

config:clockk_integration_plug,client_secret: "your-clockk-client-secret"

add some plugs to your pipeline in router.ex:

pipeline:incoming_webhookdoplug:accepts,["html"]plug:fetch_sessionplug:fetch_flashplugClockkIntegrationPlug.ValidateHMAC# FixCSRF allows Plug's CSRF to work inside of iFrames. Include this plug if you want to# submit forms inside of your Clockk extensions.plugClockkIntegrationPlug.FixCSRF# Remove iframe blocking headers when you are attempting to render inside of Clockk's UIplugClockkIntegrationPlug.ShowInIFrame# Conveniece function to place the Clockk-provided resource inside of connplugClockkIntegrationPlug.ClockkResourceplug:put_secure_browser_headersendscope"/",ClockkFreshBooksWebdopipe_through:incoming_webhookpost"/clockk-actions",ActionController,:handle_actionend

The ClockkIntegrationPlug.ClockkResource plug will place the request's Clockk resource inside of conn.private.clockk_resource and the Integration Performed Actions for the current Clockk resource inside of conn.private.integration_performed_actions

<h2>Select a Harvest project to link with <%= @conn.private.clockk_resource.name %></h2>

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/clockk_integration_plug.

About

Some useful plugs to make a Clockk integration with Phoenix framework

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages