()
| 44 | const storage = new Storage(); |
| 45 | |
| 46 | async function createNotification() { |
| 47 | try { |
| 48 | // Creates a notification |
| 49 | await storage.bucket(bucketName).createNotification(topic); |
| 50 | |
| 51 | console.log('Notification subscription created.'); |
| 52 | } catch (error) { |
| 53 | console.error( |
| 54 | 'Error executing create notification:', |
| 55 | error.message || error |
| 56 | ); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | createNotification(); |
| 61 | // [END storage_create_bucket_notifications] |