Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ericdude4 committed Aug 17, 2020
1 parent 0030411 commit 18c3ee2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ by adding `shopifex` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:shopifex, "~> 0.1.2"}
{:shopifex, "~> 0.2.0"}
]
end
```
Expand All @@ -26,6 +26,7 @@ config :shopifex,
shop_schema: MyApp.Shop,
repo: MyApp.Repo,
redirect_uri: "https://myapp.ngrok.io/auth/install",
reinstall_uri: "https://myapp.ngrok.io/auth/update",
webhook_uri: "https://myapp.ngrok.io/webhook",
scopes: "read_inventory,write_inventory,read_products,write_products,read_orders",
api_key: "shopifyapikey123",
Expand Down Expand Up @@ -72,13 +73,14 @@ pipeline :shopify_webhook do
end
```

Now add this basic example of these plugs in action in `router.ex`
Now add this basic example of these plugs in action in `router.ex`. These endpoints need to be added to your Shopify app whitelist

```elixir
scope "/auth", MyAppWeb do
pipe_through [:browser, :shopify_entrypoint]
get "/", AuthController, :auth
get "/install", AuthController, :install
get "/update", AuthController, :update
end

scope "/", MyAppWeb do
Expand Down Expand Up @@ -160,5 +162,5 @@ end
To add e.g. the `read_customers` scope, you can do so by redirecting them to the following example url:

```
https://{shop-name}.myshopify.com/admin/oauth/request_grant?client_id=API_KEY&redirect_uri={YOUR_REDIRECT_URL}/auth/update&scope={YOUR_SCOPES},read_customers
https://{shop-name}.myshopify.com/admin/oauth/request_grant?client_id=API_KEY&redirect_uri={YOUR_REINSTALL_URL}/auth/update&scope={YOUR_SCOPES},read_customers
```

0 comments on commit 18c3ee2

Please sign in to comment.