| 37 | const storage = new Storage(); |
| 38 | |
| 39 | async function listNotifications() { |
| 40 | try { |
| 41 | // Lists notifications in the bucket |
| 42 | const [notifications] = await storage |
| 43 | .bucket(bucketName) |
| 44 | .getNotifications(); |
| 45 | |
| 46 | console.log('Notifications:'); |
| 47 | notifications.forEach(notification => { |
| 48 | console.log(notification.id); |
| 49 | }); |
| 50 | } catch (error) { |
| 51 | console.error( |
| 52 | 'Error executing list notifications:', |
| 53 | error.message || error |
| 54 | ); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | listNotifications(); |
| 59 | // [END storage_list_bucket_notifications] |