api_analytics 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 168ec8494abbf47ad60453d1a21f836f9b860b65caaa7816ade1bea3627d72da
4
- data.tar.gz: 4e88773a2b4cab22e0e39a256ca737817d761e0ff47275f43fb26950bb4a042b
3
+ metadata.gz: dea99b41bffb7846c39fc219d7736efda2232246b386a70c4dca5d9fa8f235a1
4
+ data.tar.gz: 0c7f969e0b082cbc2de60bcd09f58a7c220969dea4a1f091ef93e0159aa5afaf
5
5
  SHA512:
6
- metadata.gz: efd0cdc91ebcdc11db6a7a7fc4135e9c336a5a71441b9a5be8324738451efcace71d4685c16ad999dea36cb1d88670640f768d3fab0ef5adf8658d55d7b04f0d
7
- data.tar.gz: f4ea4b6320d3e47fc9634bdded2cf3c4f4b61914721f1dc28c913565c9bee6cafdf9cd838b5dd8c3502c40e34816b7bba3c1aca4e345c3f4c010eb2f04bc2a55
6
+ metadata.gz: 53885410b819a0f3152ba162d3c11bb24671be31e03fc3d02abe3b3646d5e9a521474027e7d03c8517cfab1f0016fb0ffc952fe8b544db88a885386689878244
7
+ data.tar.gz: 9599df056ba7cd60560a71617b4dcc38579491abbfce70efc672906443e2ecd4ccf30bdda9b47b86624f171a157c5110e4b40d19b8e7802342b33a812cab3fcc
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2022 Tom Draper
3
+ Copyright (c) 2023 Tom Draper
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -4,13 +4,13 @@ A lightweight API analytics solution, complete with a dashboard.
4
4
 
5
5
  ## Getting Started
6
6
 
7
- ### 1. Generate a new API key
7
+ ### 1. Generate an API key
8
8
 
9
- Head to https://my-api-analytics.vercel.app/generate to generate your unique API key with a single click. This key is used to monitor your specific API, so keep it secret! It's also required in order to view your APIs analytics dashboard.
9
+ Head to https://apianalytics.dev/generate to generate your unique API key with a single click. This key is used to monitor your specific API and should be stored privately. It's also required in order to view your API analytics dashboard.
10
10
 
11
11
  ### 2. Add middleware to your API
12
12
 
13
- Add our lightweight middleware to your API. Almost all processing is handled by our servers so there should be virtually no impact on your APIs performance.
13
+ Add our lightweight middleware to your API. Almost all processing is handled by our servers so there is minimal impact on the performance of your API.
14
14
 
15
15
  ```bash
16
16
  gem install api_analytics
@@ -55,33 +55,58 @@ end
55
55
 
56
56
  ### 3. View your analytics
57
57
 
58
- Your API will now log and store incoming request data on all valid routes. Your logged data can be viewed using two methods: through visualizations and stats on our dashboard, or accessed directly via our data API.
58
+ Your API will now log and store incoming request data on all valid routes. Your logged data can be viewed using two methods:
59
59
 
60
- You can use the same API key across multiple APIs, but all your data will appear in the same dashboard. We recommend generating a new API key for each additional API you want analytics for.
60
+ 1. Through visualizations and statistics on our dashboard
61
+ 2. Accessed directly via our data API
62
+
63
+ You can use the same API key across multiple APIs, but all your data will appear in the same dashboard. We recommend generating a new API key for each additional API server you want analytics for.
61
64
 
62
65
  #### Dashboard
63
66
 
64
- Head to https://my-api-analytics.vercel.app/dashboard and paste in your API key to access your dashboard.
67
+ Head to https://apianalytics.dev/dashboard and paste in your API key to access your dashboard.
65
68
 
66
- Demo: https://my-api-analytics.vercel.app/dashboard/demo
69
+ Demo: https://apianalytics.dev/dashboard/demo
67
70
 
68
- ![Dashboard](https://user-images.githubusercontent.com/41476809/208440202-966a6930-3d2e-40c5-afc7-2fd0107d6b4f.png)
71
+ ![Dashboard](https://user-images.githubusercontent.com/41476809/211800529-a84a0aa3-70c9-47d4-aa0d-7f9bbd3bc9b5.png)
69
72
 
70
73
  #### Data API
71
74
 
72
- Logged data for all requests can be accessed via our API. Simply send a GET request to `https://api-analytics-server.vercel.app/api/data` with your API key set as `API-Key` in headers.
75
+ Logged data for all requests can be accessed via our REST API. Simply send a GET request to `https://apianalytics-server.com/api/data` with your API key set as `X-AUTH-TOKEN` in headers.
76
+
77
+ ##### Python
73
78
 
74
79
  ```py
75
80
  import requests
76
81
 
77
82
  headers = {
78
- "API-Key": <API-KEY>
83
+ "X-AUTH-TOKEN": <API-KEY>
79
84
  }
80
85
 
81
- response = requests.get("https://api-analytics-server.vercel.app/api/data", headers=headers)
86
+ response = requests.get("https://apianalytics-server.com/api/data", headers=headers)
82
87
  print(response.json())
83
88
  ```
84
89
 
90
+ ##### Node.js
91
+
92
+ ```js
93
+ fetch("https://apianalytics-server.com/api/data", {
94
+ headers: { "X-AUTH-TOKEN": <API-KEY> },
95
+ })
96
+ .then((response) => {
97
+ return response.json();
98
+ })
99
+ .then((data) => {
100
+ console.log(data);
101
+ });
102
+ ```
103
+
104
+ ##### cURL
105
+
106
+ ```bash
107
+ curl --header "X-AUTH-TOKEN: <API-KEY>" https://apianalytics-server.com/api/data
108
+ ```
109
+
85
110
  ## Monitoring (coming soon)
86
111
 
87
112
  Opt-in active API monitoring is coming soon. Our servers will regularly ping your API endpoints to monitor uptime and response time. Optional email alerts to notify you when your endpoints are down can be subscribed to.
@@ -104,8 +129,25 @@ For any given request to your API, data recorded is limited to:
104
129
  - API hostname
105
130
  - API framework (FastAPI, Flask, Express etc.)
106
131
 
107
- Data collected is only ever used to populate your analytics dashboard. Your data is anonymous, with the API key the only link between you and you API's analytics. Should you lose your API key, you will have no method to access your API analytics. Inactive API keys (> 1 year) and its associated API request data may be deleted.
132
+ Data collected is only ever used to populate your analytics dashboard. All data stored is anonymous, with the API key the only link between you and your logged request data. Should you lose your API key, you will have no method to access your API analytics.
108
133
 
109
134
  ### Delete Data
110
135
 
111
- At any time, you can delete all stored data associated with your API key by going to https://my-api-analytics.vercel.app/delete and entering your API key.
136
+ At any time, you can delete all stored data associated with your API key by going to https://apianalytics.dev/delete and entering your API key.
137
+
138
+ API keys and their associated API request data are scheduled be deleted after 1 year of inactivity.
139
+
140
+ ## Development
141
+
142
+ This project is still in the early stages of development and bugs are to be expected.
143
+
144
+ ## Contributions
145
+
146
+ Contributions, issues and feature requests are welcome.
147
+
148
+ - Fork it (https://github.com/tom-draper/api-analytics)
149
+ - Create your feature branch (`git checkout -b my-new-feature`)
150
+ - Commit your changes (`git commit -am 'Add some feature'`)
151
+ - Push to the branch (`git push origin my-new-feature`)
152
+ - Create a new Pull Request
153
+
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Analytics
4
- VERSION = "1.1.1"
4
+ VERSION = "1.1.2"
5
5
  end
data/lib/api_analytics.rb CHANGED
@@ -41,7 +41,7 @@ module Analytics
41
41
  requests: requests,
42
42
  framework: framework
43
43
  }
44
- uri = URI('https://213.168.248.206/api/log-request')
44
+ uri = URI('https://www.apianalytics-server.com/api/log-request')
45
45
  res = Net::HTTP.post(uri, payload.to_json)
46
46
  end
47
47
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_analytics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Draper
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-03 00:00:00.000000000 Z
11
+ date: 2023-04-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Monitoring and analytics for API applications.
14
14
  email: