You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+53-16Lines changed: 53 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,29 @@
5
5
The `revolution/laravel-threads` package is a Laravel library that provides comprehensive integration with Meta's Threads platform. It serves Laravel developers who need to:
6
6
7
7
-**Authenticate users via Threads OAuth** using Laravel Socialite
8
-
-**Publish content to Threads** (text posts, images, videos, carousels)
-**Publish content to Threads** (text posts, images, videos, carousels, polls)
9
+
-**Manage Threads content** (delete, repost, search, status checking)
10
10
-**Send notifications through Threads** via Laravel's notification system
11
11
-**Retrieve user profiles and posts** from the Threads API
12
+
-**Monitor publishing quotas** and API limits
12
13
13
-
The package abstracts the complexity of the Threads API behind familiar Laravel patterns (facades, service providers, notifications), enabling developers to integrate Threads functionality without dealing with raw HTTP requests or OAuth flows. It supports both direct API usage and Laravel's notification system for automated posting.
14
+
The package abstracts the complexity of the Threads API behind familiar Laravel patterns (facades, service providers, notifications), enabling developers to integrate Threads functionality without dealing with raw HTTP requests or OAuth flows. It supports both direct API usage and Laravel's notification system for automated posting, with extensibility through Laravel's macro system.
14
15
15
16
**Target Users**: Laravel application developers building social media integrations, content management systems, or marketing automation tools that need to interact with Threads.
16
17
18
+
## Token Management
19
+
20
+
The package handles two types of Threads API tokens:
21
+
22
+
-**Short-lived tokens**: Obtained through Socialite OAuth flow, valid for limited time
23
+
-**Long-lived tokens**: Valid for 60-90 days, required for API operations
24
+
25
+
Key token management features:
26
+
- Automatic conversion from short-lived to long-lived tokens via `exchangeToken()`
27
+
- Token refresh capability via `refreshToken()` for continuous access
28
+
- Support for Threads tester tokens (pre-generated as long-lived)
29
+
- Database storage recommended (tokens cannot be stored in `.env` permanently)
30
+
17
31
## Project Organization
18
32
19
33
### Core Systems
@@ -23,7 +37,8 @@ The package is organized into four main subsystems:
23
37
1.**Core API Client System** (`src/ThreadsClient.php`, `src/Contracts/Factory.php`)
24
38
- Handles direct HTTP communication with Threads API
**tokenForThreads** - Abstract method models must implement for token retrieval. Found in: `WithThreads` trait
180
+
**tokenForThreads** - Abstract method models must implement for token retrieval. Found in: `WithThreads` trait (must be implemented by classes using the trait)
148
181
149
182
**POST_DEFAULT_FIELDS** - Constant array of default API response fields. Found in: `ThreadsClient::POST_DEFAULT_FIELDS`
150
183
@@ -157,3 +190,7 @@ docs/
157
190
**is_carousel** - Boolean flag marking media for carousel inclusion. Found in: media creation methods
158
191
159
192
**sleep** - Parameter controlling publish timing/delays. Found in: `publish()` and `ThreadsMessage`
193
+
194
+
**poll_attachment** - Option for adding polls to text posts. Found in: `createText()` options
195
+
196
+
**Macroable** - Trait enabling custom method addition to ThreadsClient and ThreadsMessage. Found in: `ThreadsClient` and `ThreadsMessage` classes
0 commit comments